# smage-script for app-dir/foobar # # The filename must correspond to these settings. # This file must be named to foobar-1.2.3.5-r1.smage2 # PNAME="foobar" PVER="1.2.3.5" PBUILD="r1" # # A list of valid categories can by found in the mage-profile # PCAT="sys-apps" # # deprecated and gets dropped in the future, so please use PCAT #PCATEGORIE="sys-apps" # # State of the package. Can be set to 'stable', 'testing' and 'unstable' # This variable does not need be set in every package, # the distribution file of the repository is preferred. # Only set global overrides here. # STATE="unstable" # # Sets the licenses of the package-source. # This can be set to more than one. # All supported licenses can be found at /usr/share/licenses # LICENSE="gpl-2 lgpl" # # Source filename and location of the builddir # SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" # # Set some nifty mage-features at compile time. # See /etc/mage.rc.global for further details. # msetfeature "libtool" "!strip" "!distcc" "check" # # You may want to pull in some includes. # See ${SMAGESCRIPTSDIR}/includes for further details. # sminclude mtools # # All download uris needed by the package. # SRC_URI=( http://${PNAME}.org/${SRCILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-${PVER}-foo.patch ) # # Unpacks and prepare the source for compilation. # Patches and fixes goes here too. # src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # Apply a patch. mpatch ${PNAME}-${PVER}-foo.patch || die } # # All tasks to compile the source are in this function. # src_compile() { cd ${SRCDIR} mconfigure || die mmake || die } # # Run checks after compilation to find build errors. # Most packages includes a testsuite. # src_check() { cd ${SRCDIR} mmake -k check || die } # # Everything which is needed to install a packages # should be run here. # src_install() { cd ${SRCDIR} mmake DESTDIR=${BINDIR} install || die # Alternative if a Makefile does not support DESTDIR. # The PREFIX variable gets expanded by BINDIR. # But you should try to use the DESTDIR directive. #minstall || die # Install some included docs. minstalldocs AUTHOR BUGS COPYING TODO || die } preinstall() { echo "Running preinstall ..." echo "You should add users here" mgroupadd groupname museradd username } postinstall() { echo "Running postinstall ..." echo "Services should be started here using the mtools functions" # SysV Init/busybox mstartservice sshd # systemd mstartunit sshd.service echo "Some dependent services might get reloaded as well, like dbus" # SysV Init/busybox mreloadservice dbus # systemd mreloadunit dbus } preremove() { echo "Running preremove ..." } postremove() { echo "Running postinstall ..." echo "Services should be stopped here using the mtools functions" # SysV Init/busybox mstopservice sshd # systemd mstopunit sshd.service echo "Some dependent services might get reloaded as well, like dbus" # SysV Init/busybox mreloadservice dbus # systemd mreloadunit dbus }