source: npl/system/dcron/dcron.SlackBuild.orig @ a1525ed

gcc484perl-5.22
Last change on this file since a1525ed was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 3.9 KB
Line 
1#!/bin/sh
2
3# Copyright 2009, 2010, 2012  Patrick J. Volkerding, Sebeka, MN, USA
4# All rights reserved.
5#
6# Redistribution and use of this script, with or without modification, is
7# permitted provided that the following conditions are met:
8#
9# 1. Redistributions of this script must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11#
12#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
13#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
15#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
16#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
17#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
18#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
19#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
21#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
23VERSION=${VERSION:-$(echo dcron-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
24BUILD=${BUILD:-4}
25
26# Automatically determine the architecture we're building on:
27if [ -z "$ARCH" ]; then
28  case "$( uname -m )" in
29    i?86) export ARCH=i486 ;;
30    arm*) export ARCH=arm ;;
31    # Unless $ARCH is already set, use uname -m for all other archs:
32       *) export ARCH=$( uname -m ) ;;
33  esac
34fi
35
36CWD=$(pwd)
37TMP=${TMP:-/tmp}
38PKG=$TMP/package-dcron
39
40if [ "$ARCH" = "i486" ]; then
41  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
42  LIBDIRSUFFIX=""
43elif [ "$ARCH" = "s390" ]; then
44  SLKCFLAGS="-O2"
45  LIBDIRSUFFIX=""
46elif [ "$ARCH" = "x86_64" ]; then
47  SLKCFLAGS="-O2 -fPIC"
48  LIBDIRSUFFIX="64"
49else
50  SLKCFLAGS="-O2"
51  LIBDIRSUFFIX=""
52fi
53
54rm -rf $PKG
55mkdir -p $TMP $PKG
56cd $TMP
57rm -rf dcron
58tar xvf $CWD/dcron-$VERSION.tar.?z* || exit 1
59cd dcron-$VERSION
60find . \
61 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
62 -exec chmod 755 {} \; -o \
63 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
64 -exec chmod 644 {} \;
65
66# Define TMPDIR as /var/spool/cron instead of /tmp
67zcat $CWD/defs.h.TMPDIR.diff.gz | patch -p1 || exit 1
68
69# Fix problem where user creates /var/spool/cron/crontabs/<user>.new
70# using 'crontab -', exits with control-c, and then crontab refuses to
71# overwrite the junk file.  It would be better if dcron would wipe
72# the junk file in the event it were not closed correctly, but oh well.
73zcat $CWD/crontab.c.O_EXCL.diff.gz | patch -p1 || exit 1
74
75CFLAGS+="$SLKCFLAGS" make || exit 1
76strip --strip-unneeded crond crontab
77
78mkdir -p $PKG/usr/{bin,sbin}
79cat crond > $PKG/usr/sbin/crond
80cat crontab > $PKG/usr/bin/crontab
81zcat $CWD/run-parts.gz > $PKG/usr/bin/run-parts
82chmod 0755 $PKG/usr/sbin/crond
83chmod 4711 $PKG/usr/bin/crontab
84chmod 0755 $PKG/usr/bin/run-parts
85
86mkdir -p $PKG/usr/man/man{1,8}
87cat crontab.1 | gzip -9c > $PKG/usr/man/man1/crontab.1.gz
88cat crond.8 | gzip -9c > $PKG/usr/man/man8/crond.8.gz
89cat $CWD/run-parts.8.gz > $PKG/usr/man/man8/run-parts.8.gz
90
91# Create some other stuff we need
92mkdir -p $PKG/etc/cron.{hourly,daily,weekly,monthly}
93mkdir -p $PKG/var/spool/cron/crontabs
94mkdir -p $PKG/var/spool/cron/cronstamps
95chmod 0751 $PKG/var/spool/cron
96chmod 0750 $PKG/var/spool/cron/crontabs $PKG/var/spool/cron/cronstamps
97zcat $CWD/crontab.root > $PKG/var/spool/cron/crontabs/root.new
98chmod 0600 $PKG/var/spool/cron/crontabs/root.new
99# dcron will whine about "unable to scan" this directory, so we'll create it
100mkdir -p $PKG/etc/cron.d
101
102mkdir -p $PKG/usr/doc/dcron-$VERSION
103cp -a \
104  CHANGELOG README \
105  extra \
106  $PKG/usr/doc/dcron-$VERSION
107chown -R root:root $PKG/usr/doc/dcron-$VERSION/*
108
109mkdir -p $PKG/install
110cat $CWD/slack-desc > $PKG/install/slack-desc
111zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
112
113cd $PKG
114/sbin/makepkg -l y -c n $TMP/dcron-$VERSION-$ARCH-$BUILD.txz
115
Note: See TracBrowser for help on using the repository browser.