From 3a7062bd2e0be8a422cc373618e9d76d5fd934fc Mon Sep 17 00:00:00 2001 From: layman Date: Mon, 25 Feb 2013 14:43:42 +0100 Subject: martian-modem: fix compilation with kernel-3.8 --- net-dialup/martian-modem/ChangeLog | 3 + .../files/martian-modem-kernel-3.8.patch | 22 ++++++ .../martian-modem/martian-modem-20100123-r1.ebuild | 91 ++++++++++++++++++++++ .../martian-modem/martian-modem-20100123.ebuild | 86 -------------------- 4 files changed, 116 insertions(+), 86 deletions(-) create mode 100644 net-dialup/martian-modem/files/martian-modem-kernel-3.8.patch create mode 100644 net-dialup/martian-modem/martian-modem-20100123-r1.ebuild delete mode 100644 net-dialup/martian-modem/martian-modem-20100123.ebuild (limited to 'net-dialup') diff --git a/net-dialup/martian-modem/ChangeLog b/net-dialup/martian-modem/ChangeLog index b4dbccd2..8bb33925 100644 --- a/net-dialup/martian-modem/ChangeLog +++ b/net-dialup/martian-modem/ChangeLog @@ -2,6 +2,9 @@ # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 25 Feb 2012; Martin Väth + Fix compilation with kernel 3.8. Call epatch_user. + 19 Dec 2012; Martin Väth Add SLOT information diff --git a/net-dialup/martian-modem/files/martian-modem-kernel-3.8.patch b/net-dialup/martian-modem/files/martian-modem-kernel-3.8.patch new file mode 100644 index 00000000..eb138df8 --- /dev/null +++ b/net-dialup/martian-modem/files/martian-modem-kernel-3.8.patch @@ -0,0 +1,22 @@ +--- kmodule/martian.c ++++ kmodule/martian.c +@@ -46,6 +46,19 @@ + #include "../martian.h" + #include "marsio.h" + ++#ifndef __devinit ++#define __devinit ++#endif ++#ifndef __devexit ++#define __devexit ++#endif ++#ifndef __devexit_p ++#define __devexit_p ++#endif ++#ifndef __devinitdata ++#define __devinitdata ++#endif ++ + /***** Driver globals *****/ + + struct proc_dir_entry *martians_proc_dir = NULL; diff --git a/net-dialup/martian-modem/martian-modem-20100123-r1.ebuild b/net-dialup/martian-modem/martian-modem-20100123-r1.ebuild new file mode 100644 index 00000000..e9761cd0 --- /dev/null +++ b/net-dialup/martian-modem/martian-modem-20100123-r1.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 +inherit linux-mod eutils + +MY_P="martian-full-${PV}" +DESCRIPTION="ltmodem alternative driver providing support for Agere Systems winmodems" +HOMEPAGE="http://packages.debian.org/sid/martian-modem-source http://phep2.technion.ac.il/linmodems/packages/ltmodem/kernel-2.6/martian" +#SRC_URI="mirror://debian/pool/non-free/m/martian-modem/${MY_P}.tar.gz" +#SRC_URI="http://phep2.technion.ac.il/linmodems/packages/ltmodem/kernel-2.6/martian/${MY_P}.tar.gz" +SRC_URI="http://linmodems.technion.ac.il/packages/ltmodem/kernel-2.6/martian/${MY_P}.tar.gz" + +LICENSE="GPL-2 AgereSystems-WinModem" +KEYWORDS="~amd64 ~x86 -*" +IUSE="" +SLOT=0 + +DEPEND="!net-dialup/ltmodem" +RDEPEND="${DEPEND}" + +# Do NOT remove this. Stripping results in broken communication +# with core state communication channel (also see QA_* stuff below) +RESTRICT="strip" + +# contains proprietary precompiled 32 bit ltmdmobj.o +QA_PREBUILT="usr/sbin/martian_modem" + +S="${WORKDIR}/${P/modem/full}" +MODULE_NAMES="martian_dev(ltmodem::kmodule)" +CONFIG_CHECK="SERIAL_8250" +SERIAL_8250_ERROR="This driver requires you to compile your kernel with serial core (CONFIG_SERIAL_8250) support." + +pkg_setup() { + linux-mod_pkg_setup + + if kernel_is 2 4; then + eerror "This driver works only with 2.6 kernels!" + die "unsupported kernel detected" + fi +} + +src_prepare() { + # Exclude Makefile kernel version check, we used kernel_is above. + # TODO: More exactly, martian-modem-full-20100123 is for >kernel-2.6.20! + epatch "${FILESDIR}/${P}-makefile.patch" + epatch "${FILESDIR}/${P}-grsecurity.patch" + + # fix compile on amd64 + sed -i -e "/^HOST.*$/s:uname -i:uname -m:" modem/Makefile || die "sed failed" + + BUILD_TARGETS="all" + BUILD_PARAMS="KERNEL_DIR='${KV_DIR}' SUBLEVEL='${KV_PATCH}'" + + if kernel_is ge 3 8 + then epatch "${FILESDIR}/${PN}-kernel-3.8.patch" + fi + epatch_user +} + +src_install() { + linux-mod_src_install + + # userspace daemon and initscripts stuff + dosbin modem/martian_modem + newconfd "${FILESDIR}/${PN}.conf.d" ${PN} + newinitd "${FILESDIR}/${PN}.init.d" ${PN} +} + +pkg_postinst() { + linux-mod_pkg_postinst + + if linux_chkconfig_present SMP ; then + elog "You have SMP (symmetric multi processor) support enabled in kernel." + elog "You should run martian-modem with --smp enabled in MARTIAN_OPTS." + fi + if ! has_version net-dialup/martian-modem; then + elog "See /etc/conf.d/${PN} for configuration options." + elog "After you have finished the configuration, you need to run /etc/init.d/${PN} start" + elog + fi + if [ "$(rc-config list default | grep martian-modem)" = "" ]; then + elog "To run the userspace daemon automatically on every boot, just add it to a runlevel:" + elog "rc-update add ${PN} default" + elog + fi + if has_version net-dialup/wvdial; then + elog "If using net-dialup/wvdial, you need \"Carrier Check = no\" line." + fi +} diff --git a/net-dialup/martian-modem/martian-modem-20100123.ebuild b/net-dialup/martian-modem/martian-modem-20100123.ebuild deleted file mode 100644 index f9d50d79..00000000 --- a/net-dialup/martian-modem/martian-modem-20100123.ebuild +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI=5 -inherit linux-mod eutils - -MY_P="martian-full-${PV}" -DESCRIPTION="ltmodem alternative driver providing support for Agere Systems winmodems" -HOMEPAGE="http://packages.debian.org/sid/martian-modem-source http://phep2.technion.ac.il/linmodems/packages/ltmodem/kernel-2.6/martian" -#SRC_URI="mirror://debian/pool/non-free/m/martian-modem/${MY_P}.tar.gz" -#SRC_URI="http://phep2.technion.ac.il/linmodems/packages/ltmodem/kernel-2.6/martian/${MY_P}.tar.gz" -SRC_URI="http://linmodems.technion.ac.il/packages/ltmodem/kernel-2.6/martian/${MY_P}.tar.gz" - -LICENSE="GPL-2 AgereSystems-WinModem" -KEYWORDS="~amd64 ~x86 -*" -IUSE="" -SLOT=0 - -DEPEND="!net-dialup/ltmodem" -RDEPEND="${DEPEND}" - -# Do NOT remove this. Stripping results in broken communication -# with core state communication channel (also see QA_* stuff below) -RESTRICT="strip" - -# contains proprietary precompiled 32 bit ltmdmobj.o -QA_PREBUILT="usr/sbin/martian_modem" - -S="${WORKDIR}/${P/modem/full}" -MODULE_NAMES="martian_dev(ltmodem::kmodule)" -CONFIG_CHECK="SERIAL_8250" -SERIAL_8250_ERROR="This driver requires you to compile your kernel with serial core (CONFIG_SERIAL_8250) support." - -pkg_setup() { - linux-mod_pkg_setup - - if kernel_is 2 4; then - eerror "This driver works only with 2.6 kernels!" - die "unsupported kernel detected" - fi -} - -src_prepare() { - # Exclude Makefile kernel version check, we used kernel_is above. - # TODO: More exactly, martian-modem-full-20100123 is for >kernel-2.6.20! - epatch "${FILESDIR}/${P}-makefile.patch" - epatch "${FILESDIR}/${P}-grsecurity.patch" - - # fix compile on amd64 - sed -i -e "/^HOST.*$/s:uname -i:uname -m:" modem/Makefile || die "sed failed" - - BUILD_TARGETS="all" - BUILD_PARAMS="KERNEL_DIR='${KV_DIR}' SUBLEVEL='${KV_PATCH}'" -} - -src_install() { - linux-mod_src_install - - # userspace daemon and initscripts stuff - dosbin modem/martian_modem - newconfd "${FILESDIR}/${PN}.conf.d" ${PN} - newinitd "${FILESDIR}/${PN}.init.d" ${PN} -} - -pkg_postinst() { - linux-mod_pkg_postinst - - if linux_chkconfig_present SMP ; then - elog "You have SMP (symmetric multi processor) support enabled in kernel." - elog "You should run martian-modem with --smp enabled in MARTIAN_OPTS." - fi - if ! has_version net-dialup/martian-modem; then - elog "See /etc/conf.d/${PN} for configuration options." - elog "After you have finished the configuration, you need to run /etc/init.d/${PN} start" - elog - fi - if [ "$(rc-config list default | grep martian-modem)" = "" ]; then - elog "To run the userspace daemon automatically on every boot, just add it to a runlevel:" - elog "rc-update add ${PN} default" - elog - fi - if has_version net-dialup/wvdial; then - elog "If using net-dialup/wvdial, you need \"Carrier Check = no\" line." - fi -} -- cgit v1.2.3-65-gdbad