File: Makefile

package info (click to toggle)
gquilt 0.25-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 596 kB
  • sloc: python: 6,306; makefile: 36; sh: 23
file content (50 lines) | stat: -rw-r--r-- 1,361 bytes parent folder | download | duplicates (2)
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
VERSION:=$(subst ',,$(subst VERSION = ',,$(shell grep "VERSION = " setup.py)))
RELEASE:=$(subst ,,$(subst release = ,,$(shell grep "release = " setup.cfg)))
PREFIX=/usr
PKG_DIR=gquilt_pkg

RPMBDIR=~/rpmbuild
RPMSRC:=$(RPMBDIR)/SOURCES/$(SRCDIST)

SRCDIST:=gquilt-$(VERSION).tar.gz
RPMDIST:=gquilt-$(VERSION)-$(RELEASE).noarch.rpm

#all: $(MODULES_BIN) $(MODULES_OPT)
#	@echo "\"make install\" to install in /usr/local"

gquilt.spec: setup.py Makefile setup.cfg
	python setup.py bdist_rpm --spec-only --dist-dir .
	echo "%{_prefix}" >> gquilt.spec
	sed -i \
		-e 's/^\(python setup.py install.*\)/\1\ndesktop-file-install gquilt.desktop --dir $$RPM_BUILD_ROOT%{_datadir}\/applications/' \
		-e 's|-f INSTALLED_FILES|\n/etc/gquilt.d/qbsfe.sh|' \
		gquilt.spec

install:
	python setup.py install --prefix=$(PREFIX)
	desktop-file-install gquilt.desktop --dir $(PREFIX)/share/applications

source_dist: $(SRCDIST)

$(SRCDIST):
	python setup.py sdist --dist-dir .

rpm: $(RPMDIST)

$(RPMSRC): $(SRCDIST)
	cp $(SRCDIST) $(RPMSRC)

$(RPMBDIR)/SOURCES/gquilt.xpm:
	cp gquilt.xpm $(RPMBDIR)/SOURCES

$(RPMDIST): $(RPMSRC) gquilt.spec $(RPMBDIR)/SOURCES/gquilt.xpm
	rpmbuild -bb gquilt.spec
	cp $(RPMBDIR)/RPMS/noarch/$(RPMDIST) .

release: $(SRCDIST) $(RPMDIST)

clean:
	-rm gquilt_pkg/*.pyc gquilt_pkg/*~ *~
	-rm *.rpm *.spec *.exe *.tar.gz MANIFEST
	-rm -r build dist