aboutsummaryrefslogtreecommitdiff
path: root/base/avahi/avahi.build
blob: 4ce55b75bbc3ad940c0102d14a7669598a1584a3 (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/bin/bash
#
# Maintainer: Deposite Pirate <ofni.sknuplatem@etaripd>

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

NAME=avahi
VERSION=0.6.31
BUILD=2
DEPENDS=('libdaemon >= 0.14-1' 'expat >= 2.1.0-1' 'gdbm >= 1.10-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}: avahi
${NAME}:
${NAME}: A free Zeroconf implementation, including a system for multicast
${NAME}: DNS/DNS-SD service discovery. It allows programs to publish and
${NAME}: discover services and hosts running on a local network with no
${NAME}: specific configuration. For example, a user can plug their computer
${NAME}: into a network and Avahi automatically finds printers to print to,
${NAME}: files to look at and people to talk to, as well as advertising the
${NAME}: network services running on the machine.
${NAME}:
${NAME}: Homepage: http://avahi.org
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/rc.d/rc.avahidaemon.new
config etc/rc.d/rc.avahidnsconfd.new
config etc/avahi/avahi-daemon.conf.new
config etc/mdns.allow.new

# If the avahi users/groups don't exist add them

if grep "^avahi:x:" etc/passwd 1> /dev/null 2> /dev/null ; then
  true
else
  echo "avahi:x:61:61:avahi:/:/bin/false" >> etc/passwd
fi
if grep "^avahi::" etc/group 1> /dev/null 2> /dev/null ; then
  true
else
  echo "avahi::61:avahi" >> etc/group
fi
if grep "^avahi:" etc/shadow 1> /dev/null 2> /dev/null ; then
  true
else
  echo "avahi:*:9797:0:::::" >> etc/shadow
fi

if grep "^autoipd:x:" etc/passwd 1> /dev/null 2> /dev/null ; then
  true
else
  echo "autoipd:x:62:62:autoipd:/:/bin/false" >> etc/passwd
fi
if grep "^autoipd::" etc/group 1> /dev/null 2> /dev/null ; then
  true
else
  echo "autoipd::62:autoipd" >> etc/group
fi
if grep "^autoipd:" etc/shadow 1> /dev/null 2> /dev/null ; then
  true
else
  echo "autoipd:*:9797:0:::::" >> etc/shadow
fi
EOF

# Sources

SRCNAME[0]=${NAME}
SRCVERS[0]=${VERSION}
SRCPACK[0]=http://avahi.org/download/${SRCNAME[0]}-${SRCVERS[0]}.tar.gz
SRCCOPY[0]="LGPL21"

build0()
{
sed -i 's|$(libdir)/pkgconfig|$(datarootdir)/pkgconfig|g' Makefile.{am,in}
CFLAGS="${FLAGS}" CXXFLAGS="${FLAGS}" \
./configure \
 --build="${ARCH}-slackware-linux" \
 --disable-dependency-tracking \
 --disable-silent-rules \
 --enable-static=no \
 --enable-shared=yes \
 --enable-introspection=no \
 --prefix="${SYS_DIR[usr]}" \
 --mandir="${SYS_DIR[man]}" \
 --sysconfdir="${SYS_DIR[etc]}" \
 --libdir="${SYS_DIR[lib]}" \
 --localstatedir="${SYS_DIR[var]}" \
 --disable-qt3 \
 --disable-qt4 \
 --disable-python \
 --disable-python-dbus \
 --disable-pygtk \
 --disable-mono \
 --disable-monodoc \
 --with-distro=slackware \
 --with-systemdsystemunitdir="${SYS_DIR[systemdsystemunitdir]}" \
 --with-xml=expat \
 --with-avahi-user=avahi \
 --with-avahi-group=avahi \
 --with-autoipd-user=autoipd \
 --with-autoipd-group=autoipd \
 --with-avahi-priv-access-group=netdev
make ${JOBS}
make install DESTDIR="${PKG}"
install.cfg mdns.allow.new ${PKG}${SYS_DIR[etc]}
for manpage in \
 avahi-browse-domains avahi-publish-address avahi-publish-service \
 avahi-resolve-address avahi-resolve-host-name bvnc; do
 rm -f ${PKG}${SYS_DIR[man]}/man?/${manpage}.?
done
(
  cd ${PKG}${SYS_DIR[man]}/man1
  echo ".so man/man1/avahi-browse.1" > avahi-browse-domains.1
  echo ".so man/man1/avahi-publish.1" > avahi-publish-address.1
  echo ".so man/man1/avahi-publish.1" > avahi-publish-service.1
  echo ".so man/man1/avahi-resolve.1" > avahi-resolve-address.1
  echo ".so man/man1/avahi-resolve.1" > avahi-resolve-host-name.1
  echo ".so man/man1/bssh.1" > bvnc.1
)
config ${PKG}${SYS_DIR[etc]}/rc.d/rc.avahidaemon
config ${PKG}${SYS_DIR[etc]}/rc.d/rc.avahidnsconfd
config ${PKG}${SYS_DIR[etc]}/avahi/avahi-daemon.conf
rm -rf \
 ${PKG}${SYS_DIR[var]} \
 ${PKG}${SYS_DIR[lib]}/avahi
}

SRCNAME[1]=nss-mdns
SRCVERS[1]=0.10
SRCPACK[1]=http://0pointer.de/lennart/projects/${SRCNAME[1]}/${SRCNAME[1]}-${SRCVERS[1]}.tar.gz
SRCCOPY[1]="LGPL21"

build1()
{
CFLAGS="${FLAGS}" CXXFLAGS="${FLAGS}" \
./configure \
 --build="${ARCH}-slackware-linux" \
 --disable-dependency-tracking \
 --enable-static=no \
 --enable-shared=yes \
 --prefix="${SYS_DIR[usr]}" \
 --mandir="${SYS_DIR[man]}" \
 --sysconfdir="${SYS_DIR[etc]}" \
 --libdir="${SYS_DIR[lib]}" \
 --localstatedir="${SYS_DIR[var]}" \
 --disable-lynx \
 --enable-avahi
make ${JOBS} V=1
make install DESTDIR="${PKG}"
doc README
#FIXME: compat
(
  install.dir ${PKG}/lib64
  cd ${PKG}/lib64
  for link in libnss_mdns{4,6,,_minimal,{4,6}_minimal}.so.2; do
    ln -sf ${SYS_DIR[lib]}/${link}
  done
)
}