1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit fcaps multilib eutils toolchain-funcs flag-o-matic gnuconfig
11 DESCRIPTION="A set of tools for CD/DVD reading and recording, including cdrecord"
12 HOMEPAGE="http://sourceforge.net/projects/cdrtools/"
13 SRC_URI="mirror://sourceforge/${PN}/$([[ -z ${PV/*_alpha*} ]] && echo 'alpha')/${MY_P}.tar.bz2"
15 LICENSE="GPL-2 LGPL-2.1 CDDL-Schily"
17 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris"
18 IUSE="acl caps nls unicode"
20 RDEPEND="acl? ( virtual/acl )
21 caps? ( sys-libs/libcap )
22 nls? ( virtual/libintl )
26 nls? ( >=sys-devel/gettext-0.18.1.1 )"
28 S=${WORKDIR}/${P/_alpha[0-9][0-9]}
31 cap_sys_resource,cap_dac_override,cap_sys_admin,cap_sys_nice,cap_net_bind_service,cap_ipc_lock,cap_sys_rawio+ep usr/bin/cdrecord --
32 cap_dac_override,cap_sys_admin,cap_sys_nice,cap_net_bind_service,cap_sys_rawio+ep usr/bin/cdda2wav --
33 cap_dac_override,cap_sys_admin,cap_net_bind_service,cap_sys_rawio+ep usr/bin/readcd
39 # Remove profiled make files.
40 find -name '*_p.mk' -delete
42 # Adjusting hardcoded paths.
43 sed -i -e 's:opt/schily:usr:' \
44 $(find ./ -type f -name \*.[0-9ch] -exec grep -l 'opt/schily' '{}' '+') \
45 || die "sed opt/schily"
47 sed -i -e "s:\(^INSDIR=\t\tshare/doc/\):\1${PF}/:" \
48 $(find ./ -type f -exec grep -l 'INSDIR.\+doc' '{}' '+') \
52 sed -i -e "s:\(^INSDIR=\t\t\)lib:\1$(get_libdir):" \
53 $(find ./ -type f -exec grep -l '^INSDIR.\+lib\(/siconv\)\?$' '{}' '+') \
56 # Do not install static libraries.
57 sed -i -e 's:include\t\t.*rules.lib::' \
58 $(find ./ -type f -exec grep -l '^include.\+rules\.lib' '{}' '+') \
61 # Respect CC/CXX variables.
63 local tcCC=$(tc-getCC)
64 local tcCXX=$(tc-getCXX)
65 sed -i -e "/cc-config.sh/s|\$(C_ARCH:%64=%) \$(CCOM_DEF)|${tcCC} ${tcCC}|" \
66 rules1.top || die "sed rules1.top"
67 sed -i -e "/^\(CC\|DYNLD\|LDCC\|MKDEP\)/s|gcc|${tcCC}|" \
68 -e "/^\(CC++\|DYNLDC++\|LDCC++\|MKC++DEP\)/s|g++|${tcCXX}|" \
69 -e "/COPTOPT=/s/-O//" \
70 -e 's/$(GCCOPTOPT)//' \
71 cc-gcc.rul || die "sed cc-gcc.rul"
72 sed -i -e "s|^#CONFFLAGS +=\t-cc=\$(XCC_COM)$|CONFFLAGS +=\t-cc=${tcCC}|g" \
73 rules.cnf || die "sed rules.cnf"
75 # Create additional symlinks needed for some archs (armv4l already created)
77 for t in armv4tl armv5tel armv7l ppc64 s390x; do
78 ln -s i586-linux-cc.rul ${t}-linux-cc.rul || die
79 ln -s i586-linux-gcc.rul ${t}-linux-gcc.rul || die
85 [[ ${CHOST} == *-darwin* ]] && os="mac-os10"
88 -e "s:/opt/schily:/usr:g" \
89 -e "s:/usr/src/linux/include::g" \
91 -e '/^DEFUMASK/s,002,022,g' \
92 Defaults.${os} || die "sed Schily make setup"
94 # bug 486680: grsec TPE will block the exec if the directory is
95 # group-writable. This is painful with cdrtools, because it makes a bunch of
96 # group-writable directories during build. Change the umask on their
97 # creation to prevent this.
100 # skip obsolete configure script
101 src_configure() { : ; }
105 local flags="$(test-flags -finput-charset=ISO-8859-1 -fexec-charset=UTF-8)"
106 if [[ -n ${flags} ]]; then
107 append-flags ${flags}
109 ewarn "Your compiler does not support the options required to build"
110 ewarn "cdrtools with unicode in USE. unicode flag will be ignored."
115 CFLAGS="${CFLAGS} -DNO_LINUX_CAPS"
119 CFLAGS="${CFLAGS} -DNO_ACL"
122 # If not built with -j1, "sometimes" cdda2wav will not be built.
123 emake -j1 CC="$(tc-getCC)" CPPOPTX="${CPPFLAGS}" COPTX="${CFLAGS}" \
124 LDOPTX="${LDFLAGS}" \
125 INS_BASE="${ED}/usr" INS_RBASE="${ED}" LINKMODE="dynamic" \
126 RUNPATH="" GMAKE_NOWARN="true"
130 # If not built with -j1, "sometimes" manpages are not installed.
131 emake -j1 CC="$(tc-getCC)" CPPOPTX="${CPPFLAGS}" COPTX="${CFLAGS}" \
132 LDOPTX="${LDFLAGS}" \
133 INS_BASE="${ED}/usr" INS_RBASE="${ED}" LINKMODE="dynamic" \
134 RUNPATH="" GMAKE_NOWARN="true" install
136 # These symlinks are for compat with cdrkit.
137 dosym schily /usr/include/scsilib
138 dosym ../scg /usr/include/schily/scg
140 dodoc ABOUT Changelog* CONTRIBUTING PORTING README.linux-shm READMEs/README.linux
144 dodoc Changelog FAQ Frontends HOWTOUSE NEEDED README THANKS TODO
148 dodoc ChangeLog* TODO
150 # Remove man pages related to the build system
151 rm -rvf "${ED}"/usr/share/man/man5
157 if [[ ${CHOST} == *-darwin* ]] ; then
159 einfo "Darwin/OS X use the following device names:"
161 einfo "CD burners: (probably) ./cdrecord dev=IOCompactDiscServices"
163 einfo "DVD burners: (probably) ./cdrecord dev=IODVDServices"