aboutsummaryrefslogtreecommitdiff
path: root/base/sound/sound.build
blob: 7125abc42f8932164d9d8724af1d79677a6ce1db (plain)
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/bash
#
# Maintainer: Deposite Pirate <ofni.sknuplatem@etaripd>

source /usr/src/ports/Build/build.sh

NAME=sound
VERSION=1.0.27
BUILD=1

# Description

cat > ${PKG}/install/slack-desc <<EOF
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':'.

$(padd)|-----handy-ruler------------------------------------------------------|
${NAME}: sound (Advanced Linux Sound Architecture)
${NAME}:
${NAME}: The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI
${NAME}: functionality to the Linux operating system.
${NAME}:
${NAME}: This package provides the ALSA libraries and utilities.
${NAME}:
${NAME}: Homepage: http://alsa-project.org
${NAME}:
${NAME}:
${NAME}:
EOF

cat >> ${PKG}/install/doinst.sh <<EOF
#!/bin/sh

config() {
  NEW="\$1"
  OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r \$OLD ]; then
    mv \$NEW \$OLD
  elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then
    # toss the redundant copy
    rm \$NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

config etc/modprobe.d/snd-pcsp.conf.new
config etc/rc.d/rc.alsa.new

if [ ! -d run/alsactl ]; then
  install -d -m 0755 run/alsactl
fi
EOF

# Sources

ALSAREPO="ftp://ftp.alsa-project.org/pub/lib"

SRCNAME[0]=alsa-lib
SRCVERS[0]=${VERSION}
SRCPACK[0]=${ALSAREPO}/${SRCNAME[0]}-${SRCVERS[0]}.tar.bz2
SRCCOPY[0]="LGPL21"

build0()
{
CFLAGS="${FLAGS}" CXXFLAGS="${FLAGS}" \
./configure \
 --build="${ARCH}-slackware-linux" \
 --disable-dependency-tracking \
 --disable-silent-rules \
 --enable-static=no \
 --enable-shared=yes \
 --prefix="${SYS_DIR[usr]}" \
 --mandir="${SYS_DIR[man]}" \
 --sysconfdir="${SYS_DIR[etc]}/alsa" \
 --libdir="${SYS_DIR[lib]}" \
 --localstatedir="${SYS_DIR[var]}" \
 --disable-python \
 --with-configdir="${SYS_DIR[share]}/alsa" \
 --with-plugindir="${SYS_DIR[lib]}/plugins/alsa-1" \
 --with-pkgconfdir="${SYS_DIR[share]}/pkgconfig"
make ${JOBS} V=1
make install DESTDIR="${PKG}"
install.dir ${PKG}${SYS_DIR[etc]}/alsa
install.dat doc/asoundrc.txt ${PKG}${SYS_DIR[etc]}/alsa/asoundrc.sample
}

SRCNAME[1]=alsa-utils
SRCVERS[1]=${VERSION}
SRCPACK[1]=${ALSAREPO}/${SRCNAME[1]}-${SRCVERS[1]}.tar.bz2
SRCCOPY[1]="GPL2"

build1()
{
CFLAGS="${FLAGS}" CXXFLAGS="${FLAGS}" \
./configure \
 --build="${ARCH}-slackware-linux" \
 --disable-dependency-tracking \
 --disable-silent-rules \
 --disable-rpath \
 --prefix="${SYS_DIR[usr]}" \
 --mandir="${SYS_DIR[man]}" \
 --sysconfdir="${SYS_DIR[etc]}/alsa" \
 --libdir="${SYS_DIR[lib]}" \
 --localstatedir="${SYS_DIR[var]}" \
 --disable-xmlto \
 --disable-alsaconf \
 --with-alsa-prefix="${PKG}${SYS_DIR[lib]}" \
 --with-alsa-inc-prefix="${PKG}${SYS_DIR[include]}" \
 --with-udev-rules-dir="${SYS_DIR[udevrules]}" \
 --with-systemdsystemunitdir="${SYS_DIR[systemdsystemunitdir]}" \
 --with-asound-state-dir="${SYS_DIR[var]}/lib/alsa" \
 --with-alsactl-pidfile-dir="${SYS_DIR[run]}/alsactl"
make ${JOBS} V=1
make install DESTDIR="${PKG}"
install.dir ${PKG}${SYS_DIR[etc]}/{rc,modprobe,tmpfiles}.d
install.cfg alsactl.conf.tmpfiles ${PKG}${SYS_DIR[etc]}/tmpfiles.d/alsactl.conf
install.bin rc.alsa ${PKG}${SYS_DIR[etc]}/rc.d/rc.alsa.new
install.cfg snd-pcsp.conf.modprobe ${PKG}${SYS_DIR[etc]}/modprobe.d/snd-pcsp.conf.new
install.dir ${PKG}${SYS_DIR[share]}/applications
install.dat alsamixer.desktop ${PKG}${SYS_DIR[share]}/applications
mv \
 ${PKG}${SYS_DIR[man]}/man7 \
 ${PKG}${SYS_DIR[man]}/man8
mv \
 ${PKG}${SYS_DIR[man]}/man1/alsactl.1 \
 ${PKG}${SYS_DIR[man]}/man8/alsactl.8
}