##// END OF EJS Templates
builddeb: rename --release option to --codename...
av6 -
r27209:7fbab10f default
parent child Browse files
Show More
@@ -1,227 +1,227
1 # If you want to change PREFIX, do not just edit it below. The changed
1 # If you want to change PREFIX, do not just edit it below. The changed
2 # value wont get passed on to recursive make calls. You should instead
2 # value wont get passed on to recursive make calls. You should instead
3 # override the variable on the command like:
3 # override the variable on the command like:
4 #
4 #
5 # % make PREFIX=/opt/ install
5 # % make PREFIX=/opt/ install
6
6
7 PREFIX=/usr/local
7 PREFIX=/usr/local
8 export PREFIX
8 export PREFIX
9 PYTHON=python
9 PYTHON=python
10 $(eval HGROOT := $(shell pwd))
10 $(eval HGROOT := $(shell pwd))
11 HGPYTHONS ?= $(HGROOT)/build/pythons
11 HGPYTHONS ?= $(HGROOT)/build/pythons
12 PURE=
12 PURE=
13 PYFILES:=$(shell find mercurial hgext doc -name '*.py')
13 PYFILES:=$(shell find mercurial hgext doc -name '*.py')
14 DOCFILES=mercurial/help/*.txt
14 DOCFILES=mercurial/help/*.txt
15 export LANGUAGE=C
15 export LANGUAGE=C
16 export LC_ALL=C
16 export LC_ALL=C
17 TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)
17 TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)
18
18
19 # Set this to e.g. "mingw32" to use a non-default compiler.
19 # Set this to e.g. "mingw32" to use a non-default compiler.
20 COMPILER=
20 COMPILER=
21
21
22 help:
22 help:
23 @echo 'Commonly used make targets:'
23 @echo 'Commonly used make targets:'
24 @echo ' all - build program and documentation'
24 @echo ' all - build program and documentation'
25 @echo ' install - install program and man pages to $$PREFIX ($(PREFIX))'
25 @echo ' install - install program and man pages to $$PREFIX ($(PREFIX))'
26 @echo ' install-home - install with setup.py install --home=$$HOME ($(HOME))'
26 @echo ' install-home - install with setup.py install --home=$$HOME ($(HOME))'
27 @echo ' local - build for inplace usage'
27 @echo ' local - build for inplace usage'
28 @echo ' tests - run all tests in the automatic test suite'
28 @echo ' tests - run all tests in the automatic test suite'
29 @echo ' test-foo - run only specified tests (e.g. test-merge1.t)'
29 @echo ' test-foo - run only specified tests (e.g. test-merge1.t)'
30 @echo ' dist - run all tests and create a source tarball in dist/'
30 @echo ' dist - run all tests and create a source tarball in dist/'
31 @echo ' clean - remove files created by other targets'
31 @echo ' clean - remove files created by other targets'
32 @echo ' (except installed files or dist source tarball)'
32 @echo ' (except installed files or dist source tarball)'
33 @echo ' update-pot - update i18n/hg.pot'
33 @echo ' update-pot - update i18n/hg.pot'
34 @echo
34 @echo
35 @echo 'Example for a system-wide installation under /usr/local:'
35 @echo 'Example for a system-wide installation under /usr/local:'
36 @echo ' make all && su -c "make install" && hg version'
36 @echo ' make all && su -c "make install" && hg version'
37 @echo
37 @echo
38 @echo 'Example for a local installation (usable in this directory):'
38 @echo 'Example for a local installation (usable in this directory):'
39 @echo ' make local && ./hg version'
39 @echo ' make local && ./hg version'
40
40
41 all: build doc
41 all: build doc
42
42
43 local:
43 local:
44 $(PYTHON) setup.py $(PURE) \
44 $(PYTHON) setup.py $(PURE) \
45 build_py -c -d . \
45 build_py -c -d . \
46 build_ext $(COMPILER:%=-c %) -i \
46 build_ext $(COMPILER:%=-c %) -i \
47 build_hgexe $(COMPILER:%=-c %) -i \
47 build_hgexe $(COMPILER:%=-c %) -i \
48 build_mo
48 build_mo
49 env HGRCPATH= $(PYTHON) hg version
49 env HGRCPATH= $(PYTHON) hg version
50
50
51 build:
51 build:
52 $(PYTHON) setup.py $(PURE) build $(COMPILER:%=-c %)
52 $(PYTHON) setup.py $(PURE) build $(COMPILER:%=-c %)
53
53
54 wheel:
54 wheel:
55 FORCE_SETUPTOOLS=1 $(PYTHON) setup.py $(PURE) bdist_wheel $(COMPILER:%=-c %)
55 FORCE_SETUPTOOLS=1 $(PYTHON) setup.py $(PURE) bdist_wheel $(COMPILER:%=-c %)
56
56
57 doc:
57 doc:
58 $(MAKE) -C doc
58 $(MAKE) -C doc
59
59
60 clean:
60 clean:
61 -$(PYTHON) setup.py clean --all # ignore errors from this command
61 -$(PYTHON) setup.py clean --all # ignore errors from this command
62 find contrib doc hgext i18n mercurial tests \
62 find contrib doc hgext i18n mercurial tests \
63 \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';'
63 \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';'
64 rm -f $(addprefix mercurial/,$(notdir $(wildcard mercurial/pure/[a-z]*.py)))
64 rm -f $(addprefix mercurial/,$(notdir $(wildcard mercurial/pure/[a-z]*.py)))
65 rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err
65 rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err
66 if test -d .hg; then rm -f mercurial/__version__.py; fi
66 if test -d .hg; then rm -f mercurial/__version__.py; fi
67 rm -rf build mercurial/locale
67 rm -rf build mercurial/locale
68 $(MAKE) -C doc clean
68 $(MAKE) -C doc clean
69
69
70 install: install-bin install-doc
70 install: install-bin install-doc
71
71
72 install-bin: build
72 install-bin: build
73 $(PYTHON) setup.py $(PURE) install --root="$(DESTDIR)/" --prefix="$(PREFIX)" --force
73 $(PYTHON) setup.py $(PURE) install --root="$(DESTDIR)/" --prefix="$(PREFIX)" --force
74
74
75 install-doc: doc
75 install-doc: doc
76 cd doc && $(MAKE) $(MFLAGS) install
76 cd doc && $(MAKE) $(MFLAGS) install
77
77
78 install-home: install-home-bin install-home-doc
78 install-home: install-home-bin install-home-doc
79
79
80 install-home-bin: build
80 install-home-bin: build
81 $(PYTHON) setup.py $(PURE) install --home="$(HOME)" --prefix="" --force
81 $(PYTHON) setup.py $(PURE) install --home="$(HOME)" --prefix="" --force
82
82
83 install-home-doc: doc
83 install-home-doc: doc
84 cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install
84 cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install
85
85
86 MANIFEST-doc:
86 MANIFEST-doc:
87 $(MAKE) -C doc MANIFEST
87 $(MAKE) -C doc MANIFEST
88
88
89 MANIFEST.in: MANIFEST-doc
89 MANIFEST.in: MANIFEST-doc
90 hg manifest | sed -e 's/^/include /' > MANIFEST.in
90 hg manifest | sed -e 's/^/include /' > MANIFEST.in
91 echo include mercurial/__version__.py >> MANIFEST.in
91 echo include mercurial/__version__.py >> MANIFEST.in
92 sed -e 's/^/include /' < doc/MANIFEST >> MANIFEST.in
92 sed -e 's/^/include /' < doc/MANIFEST >> MANIFEST.in
93
93
94 dist: tests dist-notests
94 dist: tests dist-notests
95
95
96 dist-notests: doc MANIFEST.in
96 dist-notests: doc MANIFEST.in
97 TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist
97 TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist
98
98
99 check: tests
99 check: tests
100
100
101 tests:
101 tests:
102 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
102 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
103
103
104 test-%:
104 test-%:
105 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
105 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
106
106
107 testpy-%:
107 testpy-%:
108 @echo Looking for Python $* in $(HGPYTHONS)
108 @echo Looking for Python $* in $(HGPYTHONS)
109 [ -e $(HGPYTHONS)/$*/bin/python ] || ( \
109 [ -e $(HGPYTHONS)/$*/bin/python ] || ( \
110 cd $$(mktemp --directory --tmpdir) && \
110 cd $$(mktemp --directory --tmpdir) && \
111 $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python )
111 $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python )
112 cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS)
112 cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS)
113
113
114 check-code:
114 check-code:
115 hg manifest | xargs python contrib/check-code.py
115 hg manifest | xargs python contrib/check-code.py
116
116
117 update-pot: i18n/hg.pot
117 update-pot: i18n/hg.pot
118
118
119 i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n/posplit i18n/hggettext
119 i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n/posplit i18n/hggettext
120 $(PYTHON) i18n/hggettext mercurial/commands.py \
120 $(PYTHON) i18n/hggettext mercurial/commands.py \
121 hgext/*.py hgext/*/__init__.py \
121 hgext/*.py hgext/*/__init__.py \
122 mercurial/fileset.py mercurial/revset.py \
122 mercurial/fileset.py mercurial/revset.py \
123 mercurial/templatefilters.py mercurial/templatekw.py \
123 mercurial/templatefilters.py mercurial/templatekw.py \
124 mercurial/templater.py \
124 mercurial/templater.py \
125 mercurial/filemerge.py \
125 mercurial/filemerge.py \
126 mercurial/hgweb/webcommands.py \
126 mercurial/hgweb/webcommands.py \
127 $(DOCFILES) > i18n/hg.pot.tmp
127 $(DOCFILES) > i18n/hg.pot.tmp
128 # All strings marked for translation in Mercurial contain
128 # All strings marked for translation in Mercurial contain
129 # ASCII characters only. But some files contain string
129 # ASCII characters only. But some files contain string
130 # literals like this '\037\213'. xgettext thinks it has to
130 # literals like this '\037\213'. xgettext thinks it has to
131 # parse them even though they are not marked for translation.
131 # parse them even though they are not marked for translation.
132 # Extracting with an explicit encoding of ISO-8859-1 will make
132 # Extracting with an explicit encoding of ISO-8859-1 will make
133 # xgettext "parse" and ignore them.
133 # xgettext "parse" and ignore them.
134 echo $(PYFILES) | xargs \
134 echo $(PYFILES) | xargs \
135 xgettext --package-name "Mercurial" \
135 xgettext --package-name "Mercurial" \
136 --msgid-bugs-address "<mercurial-devel@selenic.com>" \
136 --msgid-bugs-address "<mercurial-devel@selenic.com>" \
137 --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \
137 --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \
138 --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
138 --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
139 -d hg -p i18n -o hg.pot.tmp
139 -d hg -p i18n -o hg.pot.tmp
140 $(PYTHON) i18n/posplit i18n/hg.pot.tmp
140 $(PYTHON) i18n/posplit i18n/hg.pot.tmp
141 # The target file is not created before the last step. So it never is in
141 # The target file is not created before the last step. So it never is in
142 # an intermediate state.
142 # an intermediate state.
143 mv -f i18n/hg.pot.tmp i18n/hg.pot
143 mv -f i18n/hg.pot.tmp i18n/hg.pot
144
144
145 %.po: i18n/hg.pot
145 %.po: i18n/hg.pot
146 # work on a temporary copy for never having a half completed target
146 # work on a temporary copy for never having a half completed target
147 cp $@ $@.tmp
147 cp $@ $@.tmp
148 msgmerge --no-location --update $@.tmp $^
148 msgmerge --no-location --update $@.tmp $^
149 mv -f $@.tmp $@
149 mv -f $@.tmp $@
150
150
151 # Packaging targets
151 # Packaging targets
152
152
153 osx:
153 osx:
154 python -c 'import bdist_mpkg.script_bdist_mpkg' || \
154 python -c 'import bdist_mpkg.script_bdist_mpkg' || \
155 (echo "Missing bdist_mpkg (easy_install bdist_mpkg)"; false)
155 (echo "Missing bdist_mpkg (easy_install bdist_mpkg)"; false)
156 rm -rf dist/mercurial-*.mpkg
156 rm -rf dist/mercurial-*.mpkg
157 python -m bdist_mpkg.script_bdist_mpkg setup.py --
157 python -m bdist_mpkg.script_bdist_mpkg setup.py --
158 python contrib/fixpax.py dist/mercurial-*.mpkg/Contents/Packages/*.pkg/Contents/Archive.pax.gz
158 python contrib/fixpax.py dist/mercurial-*.mpkg/Contents/Packages/*.pkg/Contents/Archive.pax.gz
159 mkdir -p packages/osx
159 mkdir -p packages/osx
160 N=`cd dist && echo mercurial-*.mpkg | sed 's,\.mpkg$$,,'` && hdiutil create -srcfolder dist/$$N.mpkg/ -scrub -volname "$$N" -ov packages/osx/$$N.dmg
160 N=`cd dist && echo mercurial-*.mpkg | sed 's,\.mpkg$$,,'` && hdiutil create -srcfolder dist/$$N.mpkg/ -scrub -volname "$$N" -ov packages/osx/$$N.dmg
161 rm -rf dist/mercurial-*.mpkg
161 rm -rf dist/mercurial-*.mpkg
162
162
163 deb:
163 deb:
164 mkdir -p packages/debian-unknown
164 mkdir -p packages/debian-unknown
165 contrib/builddeb --release unknown
165 contrib/builddeb --codename unknown
166
166
167 docker-debian-jessie:
167 docker-debian-jessie:
168 mkdir -p packages/debian-jessie
168 mkdir -p packages/debian-jessie
169 contrib/dockerdeb jessie
169 contrib/dockerdeb jessie
170
170
171 fedora20:
171 fedora20:
172 mkdir -p packages/fedora20
172 mkdir -p packages/fedora20
173 contrib/buildrpm
173 contrib/buildrpm
174 cp rpmbuild/RPMS/*/* packages/fedora20
174 cp rpmbuild/RPMS/*/* packages/fedora20
175 cp rpmbuild/SRPMS/* packages/fedora20
175 cp rpmbuild/SRPMS/* packages/fedora20
176 rm -rf rpmbuild
176 rm -rf rpmbuild
177
177
178 docker-fedora20:
178 docker-fedora20:
179 mkdir -p packages/fedora20
179 mkdir -p packages/fedora20
180 contrib/dockerrpm fedora20
180 contrib/dockerrpm fedora20
181
181
182 fedora21:
182 fedora21:
183 mkdir -p packages/fedora21
183 mkdir -p packages/fedora21
184 contrib/buildrpm
184 contrib/buildrpm
185 cp rpmbuild/RPMS/*/* packages/fedora21
185 cp rpmbuild/RPMS/*/* packages/fedora21
186 cp rpmbuild/SRPMS/* packages/fedora21
186 cp rpmbuild/SRPMS/* packages/fedora21
187 rm -rf rpmbuild
187 rm -rf rpmbuild
188
188
189 docker-fedora21:
189 docker-fedora21:
190 mkdir -p packages/fedora21
190 mkdir -p packages/fedora21
191 contrib/dockerrpm fedora21
191 contrib/dockerrpm fedora21
192
192
193 centos5:
193 centos5:
194 mkdir -p packages/centos5
194 mkdir -p packages/centos5
195 contrib/buildrpm --withpython
195 contrib/buildrpm --withpython
196 cp rpmbuild/RPMS/*/* packages/centos5
196 cp rpmbuild/RPMS/*/* packages/centos5
197 cp rpmbuild/SRPMS/* packages/centos5
197 cp rpmbuild/SRPMS/* packages/centos5
198
198
199 docker-centos5:
199 docker-centos5:
200 mkdir -p packages/centos5
200 mkdir -p packages/centos5
201 contrib/dockerrpm centos5 --withpython
201 contrib/dockerrpm centos5 --withpython
202
202
203 centos6:
203 centos6:
204 mkdir -p packages/centos6
204 mkdir -p packages/centos6
205 contrib/buildrpm
205 contrib/buildrpm
206 cp rpmbuild/RPMS/*/* packages/centos6
206 cp rpmbuild/RPMS/*/* packages/centos6
207 cp rpmbuild/SRPMS/* packages/centos6
207 cp rpmbuild/SRPMS/* packages/centos6
208
208
209 docker-centos6:
209 docker-centos6:
210 mkdir -p packages/centos6
210 mkdir -p packages/centos6
211 contrib/dockerrpm centos6
211 contrib/dockerrpm centos6
212
212
213 centos7:
213 centos7:
214 mkdir -p packages/centos7
214 mkdir -p packages/centos7
215 contrib/buildrpm
215 contrib/buildrpm
216 cp rpmbuild/RPMS/*/* packages/centos7
216 cp rpmbuild/RPMS/*/* packages/centos7
217 cp rpmbuild/SRPMS/* packages/centos7
217 cp rpmbuild/SRPMS/* packages/centos7
218
218
219 docker-centos7:
219 docker-centos7:
220 mkdir -p packages/centos7
220 mkdir -p packages/centos7
221 contrib/dockerrpm centos7
221 contrib/dockerrpm centos7
222
222
223 .PHONY: help all local build doc clean install install-bin install-doc \
223 .PHONY: help all local build doc clean install install-bin install-doc \
224 install-home install-home-bin install-home-doc \
224 install-home install-home-bin install-home-doc \
225 dist dist-notests check tests check-code update-pot \
225 dist dist-notests check tests check-code update-pot \
226 osx fedora20 docker-fedora20 fedora21 docker-fedora21 \
226 osx fedora20 docker-fedora20 fedora21 docker-fedora21 \
227 centos5 docker-centos5 centos6 docker-centos6 centos7 docker-centos7
227 centos5 docker-centos5 centos6 docker-centos6 centos7 docker-centos7
@@ -1,91 +1,91
1 #!/bin/sh -e
1 #!/bin/sh -e
2 #
2 #
3 # Build a Mercurial debian package from the current repo
3 # Build a Mercurial debian package from the current repo
4 #
4 #
5 # Tested on Jessie (stable as of original script authoring.)
5 # Tested on Jessie (stable as of original script authoring.)
6
6
7 . $(dirname $0)/packagelib.sh
7 . $(dirname $0)/packagelib.sh
8
8
9 BUILD=1
9 BUILD=1
10 CLEANUP=1
10 CLEANUP=1
11 DEBVERSION=jessie
11 CODENAME=jessie
12 while [ "$1" ]; do
12 while [ "$1" ]; do
13 case "$1" in
13 case "$1" in
14 --release )
14 --codename )
15 shift
15 shift
16 DEBVERSION="$1"
16 CODENAME="$1"
17 shift
17 shift
18 ;;
18 ;;
19 --cleanup )
19 --cleanup )
20 shift
20 shift
21 BUILD=
21 BUILD=
22 ;;
22 ;;
23 --build )
23 --build )
24 shift
24 shift
25 CLEANUP=
25 CLEANUP=
26 ;;
26 ;;
27 --debbuilddir )
27 --debbuilddir )
28 shift
28 shift
29 DEBBUILDDIR="$1"
29 DEBBUILDDIR="$1"
30 shift
30 shift
31 ;;
31 ;;
32 * )
32 * )
33 echo "Invalid parameter $1!" 1>&2
33 echo "Invalid parameter $1!" 1>&2
34 exit 1
34 exit 1
35 ;;
35 ;;
36 esac
36 esac
37 done
37 done
38
38
39 trap "if [ '$CLEANUP' ] ; then rm -r '$PWD/debian' ; fi" EXIT
39 trap "if [ '$CLEANUP' ] ; then rm -r '$PWD/debian' ; fi" EXIT
40
40
41 set -u
41 set -u
42
42
43 if [ ! -d .hg ]; then
43 if [ ! -d .hg ]; then
44 echo 'You are not inside a Mercurial repository!' 1>&2
44 echo 'You are not inside a Mercurial repository!' 1>&2
45 exit 1
45 exit 1
46 fi
46 fi
47
47
48 gethgversion
48 gethgversion
49 debver="$version"
49 debver="$version"
50 if [ -n "$type" ] ; then
50 if [ -n "$type" ] ; then
51 debver="$debver~$type"
51 debver="$debver~$type"
52 fi
52 fi
53 if [ -n "$distance" ] ; then
53 if [ -n "$distance" ] ; then
54 debver="$debver+$distance-$node"
54 debver="$debver+$distance-$node"
55 fi
55 fi
56
56
57 control=debian/control
57 control=debian/control
58 changelog=debian/changelog
58 changelog=debian/changelog
59
59
60 if [ "$BUILD" ]; then
60 if [ "$BUILD" ]; then
61 if [ -d debian ] ; then
61 if [ -d debian ] ; then
62 echo "Error! debian control directory already exists!"
62 echo "Error! debian control directory already exists!"
63 exit 1
63 exit 1
64 fi
64 fi
65
65
66 cp -r $PWD/contrib/debian debian
66 cp -r $PWD/contrib/debian debian
67 chmod -R 0755 debian
67 chmod -R 0755 debian
68
68
69 # This looks like sed -i, but sed -i behaves just differently enough
69 # This looks like sed -i, but sed -i behaves just differently enough
70 # between BSD and GNU sed that I gave up and did the dumb thing.
70 # between BSD and GNU sed that I gave up and did the dumb thing.
71 sed "s/__VERSION__/$debver/" < $changelog > $changelog.tmp
71 sed "s/__VERSION__/$debver/" < $changelog > $changelog.tmp
72 date=$(date --rfc-2822)
72 date=$(date --rfc-2822)
73 sed "s/__DATE__/$date/" < $changelog.tmp > $changelog
73 sed "s/__DATE__/$date/" < $changelog.tmp > $changelog
74 rm $changelog.tmp
74 rm $changelog.tmp
75
75
76 debuild -us -uc -b
76 debuild -us -uc -b
77 if [ $? != 0 ]; then
77 if [ $? != 0 ]; then
78 echo 'debuild failed!'
78 echo 'debuild failed!'
79 exit 1
79 exit 1
80 fi
80 fi
81
81
82 fi
82 fi
83 if [ "$CLEANUP" ] ; then
83 if [ "$CLEANUP" ] ; then
84 echo
84 echo
85 OUTPUTDIR=${OUTPUTDIR:=packages/debian-$DEBVERSION}
85 OUTPUTDIR=${OUTPUTDIR:=packages/debian-$CODENAME}
86 find ../mercurial*.deb ../mercurial_*.build ../mercurial_*.changes \
86 find ../mercurial*.deb ../mercurial_*.build ../mercurial_*.changes \
87 -type f -newer $control -print0 | \
87 -type f -newer $control -print0 | \
88 xargs -Inarf -0 mv narf "$OUTPUTDIR"
88 xargs -Inarf -0 mv narf "$OUTPUTDIR"
89 echo "Built packages for $debver:"
89 echo "Built packages for $debver:"
90 find "$OUTPUTDIR" -type f -newer $control -name '*.deb'
90 find "$OUTPUTDIR" -type f -newer $control -name '*.deb'
91 fi
91 fi
@@ -1,34 +1,34
1 #!/bin/bash -eu
1 #!/bin/bash -eu
2
2
3 . $(dirname $0)/dockerlib.sh
3 . $(dirname $0)/dockerlib.sh
4 . $(dirname $0)/packagelib.sh
4 . $(dirname $0)/packagelib.sh
5
5
6 BUILDDIR=$(dirname $0)
6 BUILDDIR=$(dirname $0)
7 export ROOTDIR=$(cd $BUILDDIR/..; pwd)
7 export ROOTDIR=$(cd $BUILDDIR/..; pwd)
8
8
9 checkdocker
9 checkdocker
10
10
11 DEBPLATFORM="$1"
11 CODENAME="$1"
12 PLATFORM="debian-$1"
12 PLATFORM="debian-$1"
13 shift # extra params are passed to build process
13 shift # extra params are passed to build process
14
14
15 OUTPUTDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM}
15 OUTPUTDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM}
16
16
17 initcontainer $PLATFORM
17 initcontainer $PLATFORM
18
18
19 # debuild only appears to be able to save built debs etc to .., so we
19 # debuild only appears to be able to save built debs etc to .., so we
20 # have to share the .. of the current directory with the docker
20 # have to share the .. of the current directory with the docker
21 # container and hope it's writable. Whee.
21 # container and hope it's writable. Whee.
22 dn=$(basename $PWD)
22 dn=$(basename $PWD)
23
23
24 if [ $(uname) = "Darwin" ] ; then
24 if [ $(uname) = "Darwin" ] ; then
25 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
25 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
26 sh -c "cd /mnt/$dn && make clean && make local"
26 sh -c "cd /mnt/$dn && make clean && make local"
27 fi
27 fi
28 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
28 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
29 sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/builddeb --build --release $DEBPLATFORM"
29 sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/builddeb --build --codename $CODENAME"
30 contrib/builddeb --cleanup --release $DEBPLATFORM
30 contrib/builddeb --cleanup --codename $CODENAME
31 if [ $(uname) = "Darwin" ] ; then
31 if [ $(uname) = "Darwin" ] ; then
32 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
32 $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
33 sh -c "cd /mnt/$dn && make clean"
33 sh -c "cd /mnt/$dn && make clean"
34 fi
34 fi
General Comments 0
You need to be logged in to leave comments. Login now