-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (30 loc) · 1.23 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
PACKAGE := tuna
VERSION := $(shell rpm -q --qf '%{VERSION} ' --specfile rpm/SPECS/$(PACKAGE).spec | cut -d' ' -f1)
rpmdirs:
@[ -d rpm/BUILD ] || mkdir rpm/BUILD
@[ -d rpm/RPMS ] || mkdir rpm/RPMS
@[ -d rpm/SRPMS ] || mkdir rpm/SRPMS
@[ -d rpm/SOURCES ] || mkdir rpm/SOURCES
bz2: rpmdirs
git archive --format=tar --prefix=$(PACKAGE)-$(VERSION)/ HEAD | \
bzip2 -9 > rpm/SOURCES/$(PACKAGE)-$(VERSION).tar.bz2
rpm: bz2 rpmdirs
rpmbuild -ba --define "_topdir $(PWD)/rpm" rpm/SPECS/$(PACKAGE).spec
bz2dev: rpmdirs
@mkdir -p /tmp/$(PACKAGE)-$(VERSION)
@tar cf - `cat MANIFEST` | (cd /tmp/$(PACKAGE)-$(VERSION) ; tar xf -)
@(cd /tmp; tar cf - $(PACKAGE)-$(VERSION)) | bzip2 -9 > rpm/SOURCES/$(PACKAGE)-$(VERSION).tar.bz2
rpmdev: bz2dev rpmdirs
rpmbuild -ba --define "_topdir $(PWD)/rpm" rpm/SPECS/$(PACKAGE).spec
po/$(PACKAGE).pot:
xgettext -k_ -kN_ -f po/POTFILES.in -o $@
po/%.po: po/$(PACKAGE).pot
msgmerge --suffix=.old -U $@ $< && rm -f [email protected]
rpmclean:
@rm -f rpm/RPMS/*/$(PACKAGE)-$(VERSION)-*.rpm
@rm -f rpm/SRPMS/$(PACKAGE)-$(VERSION)-*.src.rpm
@rm -f rpm/SOURCES/$(PACKAGE)-$(VERSION).tar.bz2
@rm -rf rpm/BUILD/$(PACKAGE)-$(VERSION)*
pyclean:
@find . -type f \( -name \*~ -o -name \*.pyc \) -delete
clean: pyclean rpmclean