-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
48 lines (43 loc) · 1.49 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
NAME=centrify_tools
VERSION=$(shell cat VERSION)
RELEASE=$(shell cat RELEASE)
TMPDIR=$(shell pwd)/.build
all: rpm
clean:
rm -rf ${NAME}*.rpm
rm -rf ${NAME}*.pkg
rm -rf ${NAME}*.dmg
rm -rf ${TMPDIR}
rpm:
mkdir -p ${TMPDIR}/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
sed -e "s/%VERSION%/${VERSION}/g" -e "s/%RELEASE%/${RELEASE}/g" ${NAME}.spec > ${TMPDIR}/${NAME}.spec
rsync -a --exclude \.svn etc/* ${TMPDIR}/SOURCES/
rsync -a --exclude \.svn src/* ${TMPDIR}/SOURCES/
rpmbuild -vv -bb --target="noarch" --clean --define "_topdir ${TMPDIR}" ${TMPDIR}/${NAME}.spec
find ${TMPDIR}/RPMS/ -type f -name '*.rpm' -print0 | xargs -0 -I {} mv {} ./
pkg:
mkdir -p ${TMPDIR}/usr/{bin,lib}
mkdir -p ${TMPDIR}/private/etc
cp etc/ad.conf ${TMPDIR}/private/etc
cp src/ad_functions ${TMPDIR}/usr/lib
cp src/ad_group ${TMPDIR}/usr/bin
cp src/ad_host_roles ${TMPDIR}/usr/bin
cp src/ad_host_zone ${TMPDIR}/usr/bin
cp src/ad_zone_hosts ${TMPDIR}/usr/bin
cp src/ad_zone_roles ${TMPDIR}/usr/bin
cp src/ad_zones ${TMPDIR}/usr/bin
/Applications/PackageMaker.app/Contents/MacOS/PackageMaker \
--title ${NAME} \
--version "${VERSION}-${RELEASE}" \
--filter "\.DS_Store" \
--root-volume-only \
--verbose \
--no-relocate \
--target "10.5" \
--id "com.${NAME}.pkg" \
--root ${TMPDIR} \
--out "${NAME}-${VERSION}-${RELEASE}.pkg"
dmg: pkg
mkdir ${TMPDIR}/dmg
cp -pR "${NAME}-${VERSION}-${RELEASE}.pkg" ${TMPDIR}/dmg
hdiutil create "${NAME}-${VERSION}-${RELEASE}.dmg" -volname "${NAME}" -fs HFS+ -srcfolder ${TMPDIR}/dmg