aboutsummaryrefslogtreecommitdiffstats
path: root/audio/oss/Makefile
blob: d1c66f3d3c257472cc9f28421eb7ac14aa695e12 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Created by: Edward Tomasz Napierala <trasz@FreeBSD.org>
# $FreeBSD$

PORTNAME=   oss
DISTVERSION=    4.2-build2011
CATEGORIES= audio
MASTER_SITES=   http://www.opensound.com/developer/sources/stable/bsd/
DISTNAME=   ${PORTNAME}-v${DISTVERSION}-src-bsd

MAINTAINER= ports@FreeBSD.org
COMMENT=    Open Sound System

LICENSE=    BSD2CLAUSE

BUILD_DEPENDS=  gawk:${PORTSDIR}/lang/gawk

USES=       tar:bzip2 kmod pkgconfig
ALL_TARGET= all install
USE_GNOME=  gtk20
USE_RC_SUBR=    oss
WRKSRC=     ${WRKDIR}/build
PATCH_WRKSRC=   ${WRKDIR}/${DISTNAME}
SUB_FILES=  pkg-install pkg-deinstall
ONLY_FOR_ARCHS= amd64 i386

KMODDIR=    ${PREFIX}/lib/oss/modules

OSS_CONF_FILES= oss_audigyls oss_audioloop oss_cs461x oss_emu10k1x \
        oss_envy24 oss_envy24ht oss_fmedia oss_hdaudio \
        oss_ich oss_imux oss_madi oss_midiloop oss_sblive \
        oss_sbpci oss_sbxfi oss_trident oss_usb oss_userdev \
        oss_ymf7xx osscore

PROTO_DIR=  ${WRKSRC}/prototype
PROTO_ETCDIR=   ${PROTO_DIR}/etc
PROTO_BINDIR=   ${PROTO_DIR}/usr/bin
PROTO_SBINDIR=  ${PROTO_DIR}/usr/sbin
PROTO_MANDIR=   ${PROTO_DIR}/usr/share/man
PROTO_OSSLIBDIR=${PROTO_DIR}${PREFIX}/lib/oss

CONFIGURE_ENV=  CC="${CC}" HOSTCC="${CC}"

OPTIONS_DEFINE= VORBIS
OPTIONS_DEFAULT=VORBIS

VORBIS_LIB_DEPENDS= libvorbisfile.so:${PORTSDIR}/audio/libvorbis
VORBIS_CONFIGURE_ENV=   OGG_SUPPORT=YES

pre-patch:
    ${FIND} ${PATCH_WRKSRC} -name '*.man' -or \
        \( -name '*.[ch]' \! -name ossmkdep.c \) | \
        ${XARGS} ${REINPLACE_CMD} -e 's|/usr/|${PREFIX}/|g' \
        -e 's|/etc/oss|${PREFIX}/etc/oss|g'

post-patch:
    ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
        ${PATCH_WRKSRC}/setup/srcconf.c
    ${FIND} ${PATCH_WRKSRC} -name configure -or \
        -name make.local -or -name soundoff -or -name soundon | \
        ${XARGS} ${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g'

do-configure:
    ${MKDIR} ${WRKSRC}
    (cd ${WRKSRC} && \
        ${SETENV} ${CONFIGURE_ENV} ${PATCH_WRKSRC}/configure)

do-install:
    ${INSTALL_PROGRAM} ${PROTO_BINDIR}/* ${STAGEDIR}${PREFIX}/bin/
# @${ECHO_CMD} "OSSLIBDIR=${PREFIX}/lib/oss" > ${PROTO_ETCDIR}/oss.conf
    ${INSTALL_DATA} ${PROTO_ETCDIR}/oss.conf ${STAGEDIR}${PREFIX}/etc/
    -@${MKDIR} ${STAGEDIR}${PREFIX}/lib/oss 2>/dev/null
    ${INSTALL_DATA} ${PROTO_OSSLIBDIR}/soundon.user \
        ${STAGEDIR}${PREFIX}/lib/oss/soundon.user.sample
    ${INSTALL_DATA} ${PROTO_OSSLIBDIR}/sysfiles.list \
        ${STAGEDIR}${PREFIX}/lib/oss/
    ${INSTALL_DATA} ${PROTO_OSSLIBDIR}/version.dat \
        ${STAGEDIR}${PREFIX}/lib/oss/
    -@${MKDIR} ${STAGEDIR}${PREFIX}/lib/oss/conf 2>/dev/null
.for CONF_FILE in ${OSS_CONF_FILES}
    ${INSTALL_DATA} ${PROTO_OSSLIBDIR}/conf/${CONF_FILE}.conf \
        ${STAGEDIR}${PREFIX}/lib/oss/conf/${CONF_FILE}.conf.sample
.endfor
    -@${MKDIR} ${STAGEDIR}${PREFIX}/lib/oss/etc 2>/dev/null
    ${INSTALL_DATA} ${PROTO_OSSLIBDIR}/etc/devices.list \
        ${STAGEDIR}${PREFIX}/lib/oss/etc/
    -@${MKDIR} ${STAGEDIR}${PREFIX}/lib/oss/include/sys 2>/dev/null
    ${INSTALL_DATA} ${PROTO_OSSLIBDIR}/include/sys/soundcard.h \
        ${STAGEDIR}${PREFIX}/lib/oss/include/sys/
    -@${MKDIR} ${STAGEDIR}${PREFIX}/lib/oss/logs 2>/dev/null
    ${INSTALL_KLD} ${PROTO_OSSLIBDIR}/modules/*.ko ${STAGEDIR}${KMODDIR}
    ${INSTALL_MAN} ${PROTO_MANDIR}/man1/*.1.gz \
        ${STAGEDIR}${PREFIX}/man/man1/
    ${INSTALL_MAN} ${PROTO_MANDIR}/man7/*.7.gz \
        ${STAGEDIR}${PREFIX}/man/man7/
    ${INSTALL_MAN} ${PROTO_MANDIR}/man8/*.8.gz \
        ${STAGEDIR}${PREFIX}/man/man8/
    ${INSTALL_PROGRAM} ${PROTO_SBINDIR}/ossdetect \
        ${STAGEDIR}${PREFIX}/sbin/
    ${INSTALL_PROGRAM} ${PROTO_SBINDIR}/ossdevlinks \
        ${STAGEDIR}${PREFIX}/sbin/
    ${INSTALL_PROGRAM} ${PROTO_SBINDIR}/savemixer \
        ${STAGEDIR}${PREFIX}/sbin/
    ${INSTALL_SCRIPT} ${PROTO_SBINDIR}/soundoff \
        ${STAGEDIR}${PREFIX}/sbin/
    ${INSTALL_SCRIPT} ${PROTO_SBINDIR}/soundon \
        ${STAGEDIR}${PREFIX}/sbin/
    ${INSTALL_PROGRAM} ${PROTO_SBINDIR}/vmixctl \
        ${STAGEDIR}${PREFIX}/sbin/

.include <bsd.port.mk>