-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
40 lines (34 loc) · 1.12 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
VER=$(shell python smash --version)
SHELL=bash
DESTDIR=build/debian
inject-version:
sed -e "s/@VER@/$(VER)/" pkg/control.in > pkg/control
sed -e "s/@VER@/$(VER)/" pkg/rpm.spec.in > pkg/rpm.spec
# We invoke sdist here so that setup.py can create the python modules
# for the resource files
deb: sdist inject-version install
fakeroot chown -R root:root $(DESTDIR)/
mkdir -p $(DESTDIR)/DEBIAN
cp pkg/control $(DESTDIR)/DEBIAN
mkdir -p dist
fakeroot dpkg -b $(DESTDIR) dist/smash-$(VER).deb
sdist:
python setup.py sdist
rpm: sdist
mkdir -p build/rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
cp pkg/rpm.spec build/rpm/SPECS
cp dist/smash-$(VER).tar.gz build/rpm/SOURCES
rpmbuild --define "_topdir $$(pwd)/build/rpm" -bb build/rpm/SPECS/rpm.spec
cp build/rpm/RPMS/noarch/smash-$(VER)-1.noarch.rpm dist/
install: BIN=$(DESTDIR)/usr/bin
install: APP=$(DESTDIR)/usr/share/smash
install:
mkdir -p $(BIN)
mkdir -p $(APP)
mkdir -p $(APP)/smashlib
mkdir -p $(APP)/smashlib/resources
cp smash smash-gui $(BIN)
chmod +x $(BIN)/smash
chmod +x $(BIN)/smash-gui
cp smashlib/*.py $(APP)/smashlib
cp smashlib/resources/*.py $(APP)/smashlib/resources