forked from hychen/lazyscripts
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
58 lines (51 loc) · 1.91 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
49
50
51
52
53
54
55
56
57
58
DOMAIN=lazyscripts
COPYRIGHT_YEAR=2010
PYSRC=${DOMAIN}
PODIR=${PWD}/po
POFILE=${PODIR}/${DOMAIN}.pot
FIRST AUTHOR=Hsin-Yi Chen <[email protected]>, ${COPYRIGHT_YEAR}
REV_DATE=`date '+%F %R+%Z'`
LANGUAGE_TEAM=Lazyscripts Developers <[email protected]>
PODESC=lazyscripts is a script management tool
PYTHON=`which python`
DESTDIR=/
BUILDIR=$(CURDIR)/debian/lazyscripts
PROJECT=lazyscripts
VERSION=0.2.3.9
all:
@echo "make source - Create source package"
@echo "make install - Install on local system"
@echo "make buildrpm - Generate a rpm package"
@echo "make builddeb - Generate a deb package"
@echo "make clean - Get rid of scratch and byte files"
source:
$(PYTHON) setup.py sdist $(COMPILE)
install:
$(PYTHON) setup.py install --root $(DESTDIR) $(COMPILE)
run:
$(PATHON) -c "from lazyscripts import console; console.gui_run()"
buildrpm:
$(PYTHON) setup.py bdist_rpm --post-install=rpm/postinstall --pre-uninstall=rpm/preuninstall
builddeb:
# build the source package in the parent directory
# then rename it to project_version.orig.tar.gz
$(PYTHON) setup.py sdist $(COMPILE) --dist-dir=../
rename -f 's/$(PROJECT)-(.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*
# build the package
dpkg-buildpackage -i -I -rfakeroot
clean:
$(PYTHON) setup.py clean
$(MAKE) -f $(CURDIR)/debian/rules clean
rm -rf build/ MANIFEST
find . -name '*.pyc' -delete
update_pot:
@echo -n "updating po file of ${DOMAIN} - "
@pygettext -p ${PODIR} -d ${DOMAIN} ${PYSRC}
@sed -i "s/CHARSET/utf-8/" ${POFILE}
@sed -i "s/ENCODING/utf-8/" ${POFILE}
@sed -i "s/YEAR ORGANIZATION/${COPYRIGHT_YEAR} Lazyscripts Developers/" ${POFILE}
@sed -i "s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR/Hsin-Yi Chen <[email protected]>, ${COPYRIGHT_YEAR}/" ${POFILE}
@sed -i "s/YEAR-MO-DA HO:MI+ZONE/${REV_DATE}/" ${POFILE}
@sed -i 's/LANGUAGE <[email protected]>/${LANGUAGE_TEAM}/' ${POFILE}
@sed -i 's/SOME DESCRIPTIVE TITLE/${PODESC}/' ${POFILE}
@echo done!