File: Makefile

package info (click to toggle)
alien 6.54
  • links: PTS
  • area: main
  • in suites: potato
  • size: 364 kB
  • ctags: 62
  • sloc: perl: 974; makefile: 117; sh: 8
file content (52 lines) | stat: -rw-r--r-- 1,810 bytes parent folder | download
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
# Set this to wherever you want alien to install. Eg, /usr/local or /usr
PREFIX=/usr

VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)

all:

clean:
	-rm build
	-rm *.bak *.out

install:	
	install -d $(DESTDIR)/$(PREFIX)/bin
	perl -pe '$$_="\t\$$prefix=\"$(PREFIX)\";" if /PREFIX_AUTOREPLACE/;\
		$$_="\tmy \$$version_string=\"$(VER)\";" if /VERSION_AUTOREPLACE/' alien \
		> $(DESTDIR)/$(PREFIX)/bin/alien
	chmod 755 $(DESTDIR)/$(PREFIX)/bin/alien
	install -d $(DESTDIR)/$(PREFIX)/share/alien/patches \
		$(DESTDIR)/var/lib/alien
	cp -fr lib/* $(DESTDIR)/$(PREFIX)/share/alien
	cp -f patches/* $(DESTDIR)/$(PREFIX)/share/alien/patches/
	-rm -f $(DESTDIR)/$(PREFIX)/share/alien/patches/*.gz
	gzip -qf9 $(DESTDIR)/$(PREFIX)/share/alien/patches/*
	install -d $(DESTDIR)/$(PREFIX)/share/man/man1
	cp -f alien.1 $(DESTDIR)/$(PREFIX)/share/man/man1

# This updates the version number in various files.
version:
	@echo Updating version info....
	perl -i -pe "s/\@version\@/$(VER)/g" <alien.spec.in >alien.spec
	perl -i -pe "s/\@version\@/$(VER)/g" <alien.lsm.in >alien.lsm

debian:
	dpkg-buildpackage -tc -rfakeroot

rpm: version
	install -d /home/joey/src/redhat/SOURCES
	install -d /home/joey/src/redhat/BUILD
	install -d /home/joey/src/redhat/SRPMS
	install -d /home/joey/src/redhat/RPMS/noarch
	ln -sf /home/ftp/pub/code/debian/alien_$(VER).tar.gz \
		/home/joey/src/redhat/SOURCES/alien_$(VER).tar.gz
	fakeroot rpm -ba -v alien.spec --target noarch
	rm -f /home/joey/src/redhat/SOURCES/alien_$(VER).tar.gz
	mv /home/joey/src/redhat/SRPMS/* /home/ftp/pub/code/SRPMS
	mv /home/joey/src/redhat/RPMS/noarch/* /home/ftp/pub/code/RPMS/noarch
	fakroot rm -rf /home/joey/src/redhat/SOURCES \
		/home/joey/src/redhat/BUILD \
		/home/joey/src/redhat/SRPMS \
		/home/joey/src/redhat/RPMS/

.PHONY: debian