Ticket #1186: Portfile

File Portfile, 2.0 KB (added by bchesneau@…, 20 years ago)

portfile diff

Line 
1PortSystem 1.0
2name            anacron
3version         2.3
4categories      sysutils
5maintainers     bchesneau@mac.com
6description     Schedules periodic jobs on systems that are not permanently up
7long_description        Anacron is a periodic command scheduler. It executes commands \
8                                        at intervals specified in days. Unlike cron, it does not assume \
9                                        that the system is running continuously.
10homepage        http://sourceforge.net/projects/anacron
11platforms       darwin
12master_sites    sourceforge
13checksums               anacron-2.3.tar.gz md5 865cc1dfe1ed75c470d3e6de13763f03
14
15depends_run     path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
16
17patchfiles      patch-Makefile patch-README patch-anacron.8 patch-anacrontab.5
18
19use_configure no
20
21build.args PREFIX=${prefix}
22
23pre-patch {
24        reinplace "s|__PREFIX|${prefix}|g" ${portpath}/files/patch-README
25        reinplace "s|__PREFIX|${prefix}|g" ${portpath}/files/patch-anacron.8
26        reinplace "s|__PREFIX|${prefix}|g" ${portpath}/files/patch-anacrontab.5
27}
28
29pre-build {     
30        system "cp ${portpath}/files/obstack.* ${workpath}/${worksrcdir}/"
31}
32
33destroot.target install PREFIX=${destroot}${prefix}
34
35
36pre-destroot {
37        file mkdir ${destroot}${prefix}/etc/rc.d
38        file mkdir ${destroot}${prefix}/etc/cron.daily
39        file mkdir ${destroot}${prefix}/etc/cron.weekly
40        file mkdir ${destroot}${prefix}/etc/cron.monthly
41        file mkdir ${destroot}${prefix}/var/spool
42        file mkdir ${destroot}${prefix}/var/spool/anacron
43       
44        system "touch ${destroot}${prefix}/etc/cron.daily/.turd"
45        system "touch ${destroot}${prefix}/etc/cron.weekly/.turd"
46        system "touch ${destroot}${prefix}/etc/cron.monthly/.turd"
47        system "touch  ${destroot}${prefix}/var/spool/anacron/.turd"
48}
49
50post-destroot {
51        system "install -o root -m 755 -c ${portpath}/files/anacron.sh ${destroot}${prefix}/etc/rc.d"
52        reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/anacron.sh
53       
54        system "install -o root -m 755 -c ${portpath}/files/anacrontab.sample ${destroot}${prefix}/etc/anacrontab.sample"
55        reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/anacrontab.sample
56}