From ef5e67748ca6d188f82c57a46d072527b11e1094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 20 Oct 2021 15:54:08 +0200 Subject: [PATCH] Drop mkpkgng in favor of a generated port Makefile. --- .gitignore | 1 - configure.ac | 4 +- freebsd/.gitignore | 2 + freebsd/Makefile.in | 33 +++++++++ mkpkgng.in | 175 -------------------------------------------- 5 files changed, 37 insertions(+), 178 deletions(-) create mode 100644 freebsd/.gitignore create mode 100644 freebsd/Makefile.in delete mode 100644 mkpkgng.in diff --git a/.gitignore b/.gitignore index 442d37f..cc80f96 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ /libtool /ltmain.sh /missing -/mkpkgng /stamp-h1 /test-driver *~ diff --git a/configure.ac b/configure.ac index 9fe2ce1..aa5f0e8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.62]) -AC_INIT([OpenPAM], [trunk], [des@des.no], [openpam], [http://www.openpam.org/]) +AC_INIT([OpenPAM], [trunk], [des@des.no], [openpam], [https://openpam.org/]) AC_CONFIG_SRCDIR([lib/libpam/pam_start.c]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign]) @@ -130,6 +130,7 @@ AC_CONFIG_FILES([ bin/su/Makefile doc/Makefile doc/man/Makefile + freebsd/Makefile include/Makefile include/security/Makefile lib/Makefile @@ -142,7 +143,6 @@ AC_CONFIG_FILES([ modules/pam_unix/Makefile t/Makefile ]) -AC_CONFIG_FILES([mkpkgng],[chmod +x mkpkgng]) AC_CONFIG_FILES([misc/coverage.sh],[chmod +x misc/coverage.sh]) AC_CONFIG_FILES([misc/coverity.sh],[chmod +x misc/coverity.sh]) AC_OUTPUT diff --git a/freebsd/.gitignore b/freebsd/.gitignore new file mode 100644 index 0000000..438ddd4 --- /dev/null +++ b/freebsd/.gitignore @@ -0,0 +1,2 @@ +!/Makefile.in +/work diff --git a/freebsd/Makefile.in b/freebsd/Makefile.in new file mode 100644 index 0000000..90a3888 --- /dev/null +++ b/freebsd/Makefile.in @@ -0,0 +1,33 @@ +# $FreeBSD: portlint$ + +PORTNAME= @PACKAGE_TARNAME@ +PORTVERSION= @PACKAGE_VERSION@ +CATEGORIES= security devel +MASTER_SITES= # +DISTFILES= # + +MAINTAINER= @PACKAGE_BUGREPORT@ +COMMENT= BSD-licensed implementation of Pluggable Authentication Modules + +LICENSE= BSD3CLAUSE + +USES= gmake libtool pkgconfig +USE_LDCONFIG= yes +GNU_CONFIGURE= yes +INSTALL_TARGET= install-strip +TEST_TARGET= check + +DESCR= ${WRKDIR}/pkg-descr + +do-extract: + (cd @abs_top_srcdir@ && \ + ${GMAKE} distdir && ${MV} ${PKGNAME} ${WRKDIR}) + (${CAT} ${WRKSRC}/README && ${ECHO} && \ + ${ECHO} "WWW: @PACKAGE_URL@") >${DESCR} + +post-stage: + (cd ${STAGEDIR} && \ + ${FIND} -s . -type f -or -type l | cut -c 2- | \ + ${SED} -E '/\/man\//s/([0-9])$$/\1.gz/') >>${TMPPLIST} + +.include diff --git a/mkpkgng.in b/mkpkgng.in deleted file mode 100644 index f81f309..0000000 --- a/mkpkgng.in +++ /dev/null @@ -1,175 +0,0 @@ -#!/bin/sh -#- -# Copyright (c) 2013-2014 Dag-Erling Smørgrav -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# - -# Print an informational message -info() { - echo "mkpkgng: $@" -} - -# Print an error message and exit -error() { - echo "mkpkgng: $@" 1>&2 - exit 1 -} - -# Ask a yes / no question -yesno() { - while :; do - echo -n "mkpkgng: $@ (yes/no) " - read answer - case $answer in - [Yy]|[Yy][Ee][Ss]) - return 0 - ;; - [Nn]|[Nn][Oo]) - return 1 - ;; - esac - done -} - -# -# Locate source and build directory -# -srcdir="@abs_top_srcdir@" -builddir="@abs_top_builddir@" -cd "$srcdir" - -# -# Determine pkgng version and ABI -# -pkgver=$(pkg -v) -[ -n "$pkgver" ] || error "Unable to determine pkgng version." -pkgabi=$(pkg config abi) -[ -n "$pkgabi" ] || error "Unable to determine package ABI." - -# -# Determine package name and version -# -package="@PACKAGE@" -version="@PACKAGE_VERSION@" -if ! expr "$version" : "[0-9]{1,}$" >/dev/null ; then - svnversion="$(svnversion 2>&1)" - svnversion=$(expr "$svnversion" : '\([0-9][0-9]*\)[A-Z]\{0,1\}$') - if [ -n "$svnversion" ] ; then - package="$package-$version" - version="r$svnversion" - fi -fi - -# -# Locate GNU make -# -if which gmake >/dev/null ; then - make=gmake -else - make=make -fi -make="$make --no-print-directory --quiet V=0" - -# -# Create temporary directory -# -info "Creating the temporary directory." -tmproot=$(mktemp -d "${TMPDIR:-/tmp}/$package-$version.XXXXXX") -[ -n "$tmproot" -a -d "$tmproot" ] || \ - error "Unable to create the temporary directory." -trap "exit 1" INT -trap "info Deleting the temporary directory. ; rm -rf '$tmproot'" EXIT -set -e - -# -# Install into tmproot -# -info "Installing into the temporary directory." -$make install DESTDIR="$tmproot" - -# -# Compress man pages -# -find $tmproot -type d -name 'man[0-9]' | -while read mandir ; do - find $mandir -type f -name '*.[0-9]' | - while read manpage ; do - gzip "$manpage" - done - find $mandir -type l -name '*.[0-9]' | - while read manlink ; do - ln -s "$(readlink $manlink).gz" "$manlink.gz" - done -done - -# -# Generate stub manifest -# -info "Generating the stub manifest." -manifest="$tmproot/+MANIFEST" -cat >"$manifest" <>"$manifest" - -# -# Create the package -# -info "Creating the package." -pkg create -r "$tmproot" -m "$tmproot" -o "$builddir" - -# -# Done -# -info "Package created for $package-$version."