File: Makefile

package info (click to toggle)
alien 6.03hamm2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 216 kB
  • ctags: 47
  • sloc: perl: 700; makefile: 111
file content (59 lines) | stat: -rw-r--r-- 1,997 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
53
54
55
56
57
58
59
all:

clean:
	-rm build
	-rm *.bak

install:	
	install -d $(DESTDIR)/usr/bin
	install alien $(DESTDIR)/usr/bin
	install -d $(DESTDIR)/usr/lib/alien $(DESTDIR)/var/lib/alien
	cp -fa lib/* $(DESTDIR)/usr/lib/alien
	cp -f patches/* $(DESTDIR)/var/lib/alien
	-rm -f $(DESTDIR)/var/lib/alien/*.gz
	gzip -qf9 $(DESTDIR)/var/lib/alien/*
	install -d $(DESTDIR)/usr/man/man1
	cp -f alien.1 $(DESTDIR)/usr/man/man1

# This updates the version number in various files.
VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)
VERFILES=alien.spec alien.lsm
OLD_VER=$(shell perl -e '<>;<>;while(length(<>)>1){};<>;<>;$$_=<>;print m/\((.*?)\)/'<debian/changelog)
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

localdist:
# Install in the proper location on my ftp server and web server. Not intended
# for use by anyone except the author.
	if [ `hostname` = 'kite' ] ; then \
		cp ../alien_$(VER).tar.gz ../../public; \
		rm /home/ftp/pub/code/alien/* || true; \
		cp *.lsm /home/ftp/pub/code/alien; \
		cp CHANGES /home/pub/programs/alien/CHANGES; \
		echo $(VER) > /home/pub/programs/alien/LATEST-VERSION-IS; \
		cd ..; rm -rf alien-$(OLD_VER); \
		[ -f ../public/alien_$(OLD_VER).tar.gz ] && \
		tar zxf ../public/alien_$(OLD_VER).tar.gz || \
		tar zxf ../outdated/alien_$(OLD_VER).tar.gz; \
		diff -r -u --new-file --exclude alien.lsm \
			--exclude alien.spec --exclude CHANGES \
			alien-$(OLD_VER) alien-$(VER) > \
			/home/ftp/pub/code/alien/diffs/alien-$(VER).diff; \
		gzip -9f /home/ftp/pub/code/alien/diffs/alien-$(VER).diff; \
		cd /home/ftp/pub/code/alien; \
		ln -sf ../debian/alien_$(VER).tar.gz alien_$(VER).tar.gz; \
		ln -sf ../debian/alien_$(VER).tar.gz alien.tar.gz ; \
		cd /tmp; rm -f alien-$(OLD-VER); \
        fi

debian:
	dpkg-buildpackage -tc -rfakeroot

rpm:
	sudo rpm -ba -v alien.spec --buildarch noarch

dist: debian localdist rpm

.PHONY: debian