diff options
author | Sam James <sam@gentoo.org> | 2022-06-25 05:15:29 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-06-25 05:15:29 +0100 |
commit | b609cb7324518d716d722875f5f2e68619cfb98a (patch) | |
tree | 529a8e94347dc4b6b7a75b0cdc2cebc1bd6f9b91 /sys-apps/pmount | |
parent | sys-apps/pmount: fix build with musl (diff) | |
download | gentoo-b609cb7324518d716d722875f5f2e68619cfb98a.tar.gz gentoo-b609cb7324518d716d722875f5f2e68619cfb98a.tar.bz2 gentoo-b609cb7324518d716d722875f5f2e68619cfb98a.zip |
sys-apps/pmount: fix implicit function declarations
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-apps/pmount')
-rw-r--r-- | sys-apps/pmount/files/pmount-0.9.99_alpha-missing-includes.patch | 82 | ||||
-rw-r--r-- | sys-apps/pmount/pmount-0.9.99_alpha-r7.ebuild | 92 |
2 files changed, 174 insertions, 0 deletions
diff --git a/sys-apps/pmount/files/pmount-0.9.99_alpha-missing-includes.patch b/sys-apps/pmount/files/pmount-0.9.99_alpha-missing-includes.patch new file mode 100644 index 000000000000..cdcb65ad822d --- /dev/null +++ b/sys-apps/pmount/files/pmount-0.9.99_alpha-missing-includes.patch @@ -0,0 +1,82 @@ +--- a/src/conffile.c ++++ b/src/conffile.c +@@ -22,6 +22,7 @@ + #include <sys/types.h> + #include <pwd.h> + #include <grp.h> ++#include <unistd.h> + + #include "conffile.h" + #include "config.h" +--- a/src/luks.c ++++ b/src/luks.c +@@ -13,7 +13,9 @@ + #include "utils.h" + #include "policy.h" + #include <stdio.h> ++#include <fcntl.h> + #include <limits.h> ++#include <unistd.h> + #include <sys/stat.h> + #include <libintl.h> + +--- a/src/policy.c ++++ b/src/policy.c +@@ -13,6 +13,7 @@ + #include "policy.h" + #include "utils.h" + ++#include <ctype.h> + #include <stdio.h> + #include <string.h> + #include <unistd.h> +--- a/src/pmount.c ++++ b/src/pmount.c +@@ -29,6 +29,7 @@ + #include "policy.h" + #include "utils.h" + #include "luks.h" ++#include "loop.h" + #include "config.h" + + /* Configuration file handling */ +--- a/src/policy.c ++++ b/src/policy.c +@@ -33,6 +33,7 @@ + #include <pwd.h> + #include <utmpx.h> + ++#include "configuration.h" + + /* We use our own safe version of realpath */ + #include "realpath.h" +--- a/src/pumount.c ++++ b/src/pumount.c +@@ -24,6 +24,7 @@ + #include "utils.h" + #include "luks.h" + #include "config.h" ++#include "configuration.h" + + /* error codes */ + const int E_ARGS = 1; +--- a/tests/test_policy.c ++++ b/tests/test_policy.c +@@ -16,6 +16,7 @@ + #include "policy.h" + #include "utils.h" + #include <stdio.h> ++#include <string.h> + + int testsFailed = 0; + int totalTests = 0; +--- a/tests/test_spawn.c ++++ b/tests/test_spawn.c +@@ -12,6 +12,7 @@ + + + #include <stdio.h> ++#include <string.h> + #include <unistd.h> + #include "utils.h" + diff --git a/sys-apps/pmount/pmount-0.9.99_alpha-r7.ebuild b/sys-apps/pmount/pmount-0.9.99_alpha-r7.ebuild new file mode 100644 index 000000000000..baad4714b833 --- /dev/null +++ b/sys-apps/pmount/pmount-0.9.99_alpha-r7.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit bash-completion-r1 + +DESCRIPTION="Policy based mounter that gives the ability to mount removable devices as a user" +HOMEPAGE="https://launchpad.net/pmount" +SRC_URI="mirror://debian/pool/main/p/${PN}/${PN}_${PV/_/-}.orig.tar.bz2" +S="${WORKDIR}"/${P/_/-} + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="crypt" + +# cryptsetup is executed at runtime only, no libraries used AFAICT +# but in DEPEND too as it's checked during configure +RDEPEND=" + acct-group/plugdev + >=sys-apps/util-linux-2.17.2 + crypt? ( >=sys-fs/cryptsetup-1.0.6-r2 )" +DEPEND="${RDEPEND}" +BDEPEND=" + dev-util/intltool + sys-devel/gettext" + +PATCHES=( + "${FILESDIR}"/${PN}-0.9.19-testsuite-missing-dir.patch + "${FILESDIR}"/${P}-locale-regex.patch + "${FILESDIR}"/${P}-exfat-support.patch + "${FILESDIR}"/${P}-limits-musl.patch + "${FILESDIR}"/${P}-missing-includes.patch +) + +src_prepare() { + # Restore default value from pmount <= 0.9.23 wrt #393633 + sed -i -e '/^not_physically_logged_allow/s:=.*:= yes:' etc/pmount.conf || die + + cat <<-EOF > po/POTFILES.skip || die + src/conffile.c + src/configuration.c + src/loop.c + EOF + + default +} + +src_configure() { + econf --disable-hal +} + +src_test() { + local testdir=${S}/tests/check_fstab + + ln -s a "${testdir}/b" && + ln -s d "${testdir}/c" && + ln -s c "${testdir}/e" || + die "Unable to create fake symlinks required for testsuite" + + emake check +} + +src_install() { + # Must be run SETUID+SETGID, bug #250106 + exeinto /usr/bin + exeopts -m 6710 -g plugdev + doexe src/{p,pu}mount + + dodoc AUTHORS ChangeLog TODO + doman man/{{p,pu}mount.1,pmount.conf.5} + + insinto /etc + doins etc/pmount.{allow,conf} + + keepdir /media #501772 + + newbashcomp "${FILESDIR}/${PN}.bash-completion" "${PN}" + bashcomp_alias pmount pumount +} + +pkg_postinst() { + elog + elog "This package has been installed setuid and setgid." + + elog "The permissions are as such that only users that belong to the plugdev" + elog "group are allowed to run this. But if a script run by root mounts a" + elog "device, members of the plugdev group will have access to it." + elog + elog "Please add your user to the plugdev group to be able to mount USB drives" +} |