File: Makefile

package info (click to toggle)
bdii4 4.0.2.2-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 284 kB
  • ctags: 33
  • sloc: sh: 804; perl: 715; makefile: 121
file content (57 lines) | stat: -rwxr-xr-x 2,015 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
prefix=/opt/bdii
package=bdii
name=$Name: bdii_R_4_0_2_2 $
tag:=$(shell echo $(name) | sed 's/^[^:]*: //' )
version:=$(shell echo "$(tag)" | sed 's/^.*R_//' | sed 's/_/\./g')
release:=$(shell echo "$(version)" | sed 's/.*\.//')
version:=$(shell echo "$(version)" | sed 's/\(.*\)\.[0-9]*/\1/')

.PHONY: configure install clean rpm

all: configure

install:
	@echo installing ...
	@mkdir -p $(prefix)/sbin/
	@mkdir -p $(prefix)/etc/
	@mkdir -p $(prefix)/doc/
	@mkdir -p $(prefix)/bdii/man/man5
	@mkdir -p $(prefix)/bdii/man/man8
	@mkdir -p $(prefix)/../../etc/logrotate.d/
	@mkdir -p $(prefix)/../../var/bdii
	@mkdir -p $(prefix)/../../var/log/bdii

	@install -m 0755 sbin/bdii-fwd    $(prefix)/sbin
	@install -m 0755 sbin/bdii-proxy  $(prefix)/sbin
	@install -m 0755 sbin/bdii-update $(prefix)/sbin
	@install -m 0755 etc/init.d/bdii  $(prefix)/sbin
	@install -m 0755 etc/logrotate.d/bdii  ${prefix}/../../etc/logrotate.d/
	@install -m 0644 README                       $(prefix)/doc/
	@install -m 0640 etc/bdii.conf $(prefix)/etc/
	@install -m 0644 etc/bdii-update.conf $(prefix)/etc/
	@install -m 0644 etc/glue-slapd.conf	$(prefix)/etc/
	@install -m 0644 etc/DB_CONFIG         $(prefix)/etc/
	@install -m 0644 etc/default.ldif         $(prefix)/etc/
	@install -m 0644 etc/BDII.schema         $(prefix)/etc/
	@pod2man -s 5 --center "BDII Configuration" doc/section5 > doc/bdii.5
	@pod2man -s 8 --center "BDII Services"      doc/section8 > doc/bdii.8
	@install -m 0644 doc/bdii.5 $(prefix)/bdii/man/man5
	@install -m 0644 doc/bdii.8 $(prefix)/bdii/man/man8

clean::
	rm -f *~ test/*~ etc/*~ doc/*~ sbin/*~
	rm -rf rpmbuild

rpm:
	@mkdir -p  rpmbuild/RPMS/noarch
	@mkdir -p  rpmbuild/SRPMS/
	@mkdir -p  rpmbuild/SPECS/
	@mkdir -p  rpmbuild/SOURCES/
	@mkdir -p  rpmbuild/BUILD/
ifneq ("$(tag)","ame:")
	@sed -i 's/^Version:.*/Version: $(version)/' $(package).spec
	@sed -i 's/^Release:.*/Release: $(release)/' $(package).spec
endif
	@tar --gzip -cf rpmbuild/SOURCES/$(package).src.tgz *
	@rpmbuild -ba $(package).spec