# liburcu 0.15.2
# ==============
# As I write this, Slackware-current has a liburcu package, but 15.0 and down
# do not
# If you ever want to uninstall liburcu, skip down to the bottom
# Get the tarball
cd
test -f installed/userspace-rcu-0.15.2.tar.bz2 &&
mv -f installed/userspace-rcu-0.15.2.tar.bz2 .
test ! -f userspace-rcu-0.15.2.tar.bz2 &&
wget https://lttng.org/files/urcu/userspace-rcu-0.15.2.tar.bz2
# Extract the source
mkdir -m -p 0700 ~/src
cd ~/src
tar xjvf ~/userspace-rcu-0.15.2.tar.bz2
cd userspace-rcu-0.15.2
test $UID = 0 && chown -R root:root .
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --docdir=/usr/doc/userspace-rcu --libdir=/usr/lib64
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --docdir=/usr/doc/userspace-rcu
# Build it
make
# Check the build
make check
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg liburcu
# Install it
make install
ldconfig
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become your non-root user
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/liburcu-*.tar.*
mv userspace-rcu-0.15.2.tar.bz2 installed/
# If you ever want to uninstall liburcu, this should do it:
# ('make uninstall' as root should be enough, if you have configure'd source)
cd
su
test -d src/liburcu-* && ( cd src/liburcu-* ; make uninstall )
test -d /usr/doc/userspace-rcu && rm -r /usr/doc/userspace-rcu
( cd /usr/include
rm -f urcu.h urcu-{bp,call-rcu,defer,flavor,pointer,qsbr}.h )
test -d /usr/include/urcu && rm -r /usr/include/urcu
( cd /usr/lib
rm -f liburcu.* liburcu-{bp,cds,common,mb,memb,qsbr}.*
test -d pkgconfig &&
( cd pkgconfig
rm -f liburcu.pc liburcu-{bp,cds,mb,memb,qsbr}.pc ) )
test -d /usr/lib64 &&
( cd /usr/lib64
rm -f liburcu.* liburcu-{bp,cds,common,mb,memb,qsbr}.*
test -d pkgconfig &&
( cd pkgconfig
rm -f liburcu.pc liburcu-{bp,cds,mb,memb,qsbr}.pc ) )
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "liburcu-*" -exec rm -r {} \;
rm -f ~/installed/liburcu-*.tar.*