File: Makefile.PL

package info (click to toggle)
systeminstaller 1.04-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 748 kB
  • ctags: 261
  • sloc: perl: 5,769; makefile: 70
file content (119 lines) | stat: -rw-r--r-- 3,834 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
use ExtUtils::MakeMaker;
use lib '/usr/local/lib/systemimager/perl','/usr/lib/systemimager/perl';

# The global version is stored here so that it can be used by 
# the man page string in rewriting POD2MAN_EXE

my $version = "1.04";
my $release = "1";
my $releasex = "1";

sub MY::postamble {
    my $string = <<EOF;

POD2MAN5_EXE = \$(POD2MAN_EXE) "--section=5"

deb_prep ::
\tperl -pi.bak -e 's/^VERSION.*/VERSION = $version/' debian/rules

deb :: deb_prep dist
\tmkdir -p /tmp/scdeb
\tmv systeminstaller-$version.tar.gz /tmp/scdeb && cd /tmp/scdeb && tar -xvzf systeminstaller-$version.tar.gz && cd systeminstaller-$version && dpkg-buildpackage && rm -rf /tmp/scdeb/systeminstaller-$version
\techo "Debian Packages have been built in /tmp/scdeb"

rpm_prep ::
\tperl -pi.bak -e 's/\%define version\\b.*/\%define version         $version/' sin.spec
\tperl -pi.bak -e 's/\%define release\\b.*/\%define release         $release/' sin.spec
\tperl -pi.bak -e 's/\%define releasex\\b.*/\%define releasex         $releasex/' sin.spec

rpm :: srpm
\trpm -tb --target noarch \$(NAME)-\$(VERSION).tar.gz

srpm :: rpm_prep dist
\trpm -ts --target noarch \$(NAME)-\$(VERSION).tar.gz

ext_install :: conf
\tmkdir -p \$(PREFIX)/../var/lib/sis
\ttouch  \$(PREFIX)/../var/lib/sis/image
\ttouch  \$(PREFIX)/../var/lib/sis/adapter
\ttouch  \$(PREFIX)/../var/lib/sis/client

\$(PREFIX)/../etc/systeminstaller/systeminstaller.conf : samples/systeminstaller.conf \$(PREFIX)/../etc/systeminstaller
\tinstall samples/systeminstaller.conf \$(PREFIX)/../etc/systeminstaller/

\$(PREFIX)/../etc/systeminstaller/tksis.conf : samples/tksis.conf \$(PREFIX)/../etc/systeminstaller
\tinstall samples/tksis.conf \$(PREFIX)/../etc/systeminstaller/

\$(PREFIX)/../etc/systeminstaller :
\tinstall -d \$(PREFIX)/../etc/systeminstaller

conf: \$(PREFIX)/../etc/systeminstaller/tksis.conf \$(PREFIX)/../etc/systeminstaller/systeminstaller.conf

img_install ::
\tinstall -d \$(PREFIX)/share/systeminstaller/images
\tinstall tksis/images/monitor.xpm \$(PREFIX)/share/systeminstaller/images
\tinstall tksis/images/image.xpm \$(PREFIX)/share/systeminstaller/images

distinfo_install ::

\t for file in `find distinfo | grep -v CVS`; do \\
\t\t if [[ -d \$\$file ]]; then \\
\t\t\t install -d \$(PREFIX)/share/systeminstaller/\$\$file; \\
\t\t else \\
\t\t\t install \$\$file \$(PREFIX)/share/systeminstaller/\$\$file; \\
\t\t fi; \\
\t done


manifest :

\t if [[ -f MANIFEST ]]; then \\
\t\t mv MANIFEST MANIFEST.bak; \\
\t fi
\t cp MANIFEST.stub MANIFEST
\t for file in `find distinfo | grep -v CVS`; do \\
\t\t if [[ -f \$\$file ]]; then \\
\t\t\t echo \$\$file >> MANIFEST; \\
\t\t fi; \\
\t done

manext_install ::
\tcd doc && \\
\tinstall -d \$(INSTALLMAN1DIR)/../man5 && \\
\t\$(POD2MAN5_EXE) systeminstaller.conf.pod \$(INSTALLMAN1DIR)/../man5/systeminstaller.conf.5 && \\
\t\$(POD2MAN5_EXE) SIS.pod \$(INSTALLMAN1DIR)/../man1/SIS.1 && \\
\tcd ..

install :: all pure_install doc_install ext_install manext_install img_install distinfo_install

set_ver::
\tperl -pi.bak -e 's/SIVERSION=.*/SIVERSION="$version";/' ./lib/SystemInstaller/Env.pm
\tperl -pi.bak -e 's/SIVERSION=.*/SIVERSION="$version";/' ./blib/lib/SystemInstaller/Env.pm

all :: set_ver

EOF
}
#all :: set_ver pure_all htmlifypods manifypods

WriteMakefile(
              'VERSION' => $version,
              'NAME' => 'systeminstaller',
              'EXE_FILES' => [qw(
				bin/mksidisk
				bin/mksiimage 
				bin/buildimage
				bin/mksimachine
				bin/mksirange
				bin/mkdhcpconf
				bin/mkpkgcache
				bin/simigratedb
				tksis/tksis
				)],
              'INSTALLBIN' => "/usr/bin",
              'INSTALLSITELIB' => "/usr/lib/systeminstaller",
              'PREREQ_PM' => {
			      MLDBM => '2',
                              AppConfig => '1.52',
                             },
             );