blob: 000bb0d611acee51de187052db8eec4e3d8c0f96 (
plain)
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
|
VERSION=$(shell python setup.py -V)
PACKAGE=sugar-update-control
MOCK=./mock-wrapper -r olpc-3-i386 --resultdir=$(MOCKDIR) $(MOCK_OPTS)
MOCKDIR=./rpms
PKGVER=$(PACKAGE)-$(VERSION)
CWD=$(shell pwd)
# update the translation template
po/sugar-update-control.pot: src/__init__.py src/view.py src/model.py
xgettext -o $@ \
--copyright-holder="One Laptop per Child Association, Inc." \
--package-name="$(PACKAGE)" \
--package-version="$(VERSION)" \
--msgid-bugs-address="cscott@laptop.org" \
$^
# note that this builds the tarball from *committed git bits* only.
# do a git commit before invoking this.
$(PKGVER).tar.gz:
git diff --shortstat --exit-code # check that our working copy is clean
git diff --cached --shortstat --exit-code # uncommitted changes?
git archive --format=tar --prefix=$(PKGVER)/ HEAD | gzip -9 > $@
.PHONY: $(PKGVER).tar.gz # force refresh
tarball: $(PKGVER).tar.gz
# builds SRPM and RPMs in an appropriate chroot, leaving the results in
# the $(MOCKDIR) subdirectory.
# make the SRPM.
$(PKGVER)-1.src.rpm: update-version $(PKGVER).tar.gz
rpmbuild --define "_specdir $(CWD)" --define "_sourcedir $(CWD)" --define "_builddir $(CWD)" --define "_srcrpmdir $(CWD)" --define "_rpmdir $(CWD)" --define "dist %nil" --nodeps -bs $(PACKAGE).spec
# build RPMs from the SRPM
mock: $(PKGVER)-1.src.rpm
@mkdir -p $(MOCKDIR)
$(MOCK) -q --init
$(MOCK) --installdeps $(PKGVER)-1.src.rpm
$(MOCK) -v --no-clean --rebuild $(PKGVER)-1.src.rpm
upload:
@mkdir -p $(MOCKDIR)
rsync -4 -avz $(PACKAGE).changes dev.laptop.org:public_rpms/joyride
rsync -4 -avz --include="*.rpm" --exclude="*" $(MOCKDIR)/ dev.laptop.org:public_rpms/joyride
clean:
-$(RM) $(PKGVER)-1.src.rpm $(PKGVER).tar.gz
-$(RM) -rf $(MOCKDIR)
|