Commit 4f6305a9 authored by Aaditya Bagga's avatar Aaditya Bagga

Initial commit

parents
*.swp
test
*.zip
#!/bin/bash
# download.sh: Downloads openrc PKGBUILDS from https://github.com/manjaro/packages-openrc
# and fetches the source for the files.
. "$(pwd)/functions.sh"
UPSTREAM_DIR=packages-openrc-master
# Remove files previously present
rm master.zip
# Download and extract packages-openrc-master.zip
wget -c https://github.com/manjaro/packages-openrc/archive/master.zip &&
unzip -uo master.zip
# Directories to download files for
DIRS_TO_CONSIDER=(openrc-base openrc-desktop openrc-devel openrc-misc openrc-net openrc-video udev-openrc)
cd $UPSTREAM_DIR
for dir in ${DIRS_TO_CONSIDER[@]}; do
cd $dir
. "$(pwd)/PKGBUILD"
download_source
cd ..
done
#!/bin/bash
# download_misc.sh
_src_uri="http://dev.gentoo.org/~williamh/dist"
_dev_uri="http://dev.gentoo.org/~polynomial-c/dist/apache"
_udev="udev-init-scripts"
_uver=30
_apver=2.4.18-r1
_aprel=20160303
source=("${_src_uri}/${_udev}-${_uver}.tar.gz"
"${_dev_uri}/gentoo-apache-${_apver}-${_aprel}.tar.bz2")
# Download to misc folder
cd misc
for src in "${source[@]}"; do
wget -Nc "$src"
done
cd init.d
wget -Nc https://github.com/dywisor/tlp-portage/raw/maint/app-laptop/tlp/files/tlp-init.openrc-r2
#!/bin/sh
# fix_openrc_base.sh
DESTDIR=$1
# dbus
_p1='s|dbus.pid|dbus/dbus.pid|g'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/dbus"
# dhcpcd
# get dhcpcd version
dhcpcd_ver=$(ls /var/log/packages/ | grep dhcpcd | cut -f 2 -d "-")
if [ ! "$dhcpcd_ver" = '6.0.5' ]; then
# fix for slackware current
_p1='s|dhcpcd.pid|dhcpcd/dhcpcd.pid|g'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/dhcpcd"
fi
# dmeventd
sed 's| --pidfile $PIDFILE||g' -i "${DESTDIR}/etc/init.d/dmeventd"
#!/bin/sh
# fix_openrc_desktop.sh
DESTDIR=$1
# bluetooth
_p1='s|libexec/bluetooth|sbin|g'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/bluetooth"
# xdm
_p1='s|/etc/profile.env|/etc/profile|g'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/xdm"
# wpa_supplicant
if [ -f /etc/os-release ]; then
sed -e "s|gentoo-release|os-release|" -i "${DESTDIR}/etc/wpa_supplicant/wpa_cli.sh"
fi
# networkmanager
sed -e 's|@EPREFIX@||g' -i "${DESTDIR}/etc/NetworkManager/dispatcher.d/10-openrc-status"
#!/bin/sh
# fix_openrc_devel.sh
DESTDIR=$1
# mysql
#_p1='s|--exec "${basedir}"/sbin/mysqld|--exec "${basedir}"/bin/mysqld_safe|g'
_p1='s|/sbin/mysqld|/libexec/mysqld|g'
_p2='s|/etc/mysql/my.cnf|/etc/my.cnf|g'
_p3='s|STARTUP_TIMEOUT="900"|STARTUP_TIMEOUT=30|'
_p4='s|STOP_TIMEOUT=120|STOP_TIMEOUT=60|'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/mysqld"
sed -e "${_p2}" -e "${_p3}" -e "${_p4}" -i "${DESTDIR}/etc/conf.d/mysqld"
# php-fm
_p1='s|lib/${PHPSLOT}/bin|sbin|g'
_p2='s|/etc/php/fpm-${PHPSLOT}|/etc/php|'
_p3='s|/run/php-fpm-${PHPSLOT}|/run/php-fpm|'
_p4='s|PHPSLOT=${SVCNAME#php-fpm-}||'
_p5='s|^.*${PHPSLOT}.*||'
_p6='s|apache2|httpd|'
sed -e "${_p1}" -e "${_p2}" -e "${_p3}" -e "${_p4}" -e "${_p5}" -e "${_p6}" -i "${DESTDIR}/etc/init.d/php-fpm"
# postgresql
if [ "$(uname -m)" = x86_64 ]; then
_p1='s|@LIBDIR@|lib64|g'
else
_p1='s|@LIBDIR@|lib|g'
fi
# get postgresql version
postgres_ver=$(ls /var/log/packages/ | grep postgresql | cut -f 2 -d "-")
postgres_slot=$(echo "$postgres_ver" | cut -f 1-2 -d ".")
_p2='s|postgresql-@SLOT@|postgresql/@SLOT@|g'
_p3="s|@SLOT@|${postgres_slot}|g"
_p4='s|/var/lib/postgresql|/var/lib/pgsql|g'
sed -e "${_p1}" -e "${_p2}" -e "${_p3}" -i "${DESTDIR}/etc/init.d/postgresql"
sed -e "${_p2}" -e "${_p3}" -e "${_p4}" -i "${DESTDIR}/etc/conf.d/postgresql"
# subversion
_p2='s|-apache|-http|g'
sed -e "${_p2}" -i "${DESTDIR}/etc/init.d/svn"
# git-daemon
sed 's| --base-path=/var/git||' -i "${DESTDIR}/etc/conf.d/git-daemon"
#!/bin/sh
# fix_openrc_misc.sh
DESTDIR=$1
# bitlbee
_p1='s|need logger net|need net\n use logger|'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/bitlbee"
# cups
_p1='s|lp:lpadmin|daemon:sys|'
_p2='s|@neededservices@|need dbus|'
sed -e "${_p1}" -e "${_p2}" -i "${DESTDIR}/etc/init.d/cupsd"
# fcron
_p1='s|/usr/libexec|/usr/sbin|g'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/fcron"
# vboxservice
_p1='s|vboxguest-service|VBoxService|'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/vboxservice"
# libvirt
_p1='s|USE_FLAG_FIREWALLD||'
_p2='s|USE_FLAG_AVAHI||'
_p3='s|USE_FLAG_ISCSI||'
_p4='s|USE_FLAG_RBD||'
sed -e "${_p1}" -e "${_p2}" -e "${_p3}" -e "${_p4}" -i "${DESTDIR}/etc/init.d/libvirtd"
# saned
_p1='s|saned/saned.pid|saned.pid|g'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/saned"
# zfs
_p1='s|/usr/bin/zfs|/sbin/zfs|'
_p2='s|/usr/bin/zpool|/sbin/zpool|'
sed -e "${_p1}" -e "${_p2}" -i "${DESTDIR}/etc/init.d/zfs"
#!/bin/sh
# fix_openrc_net.sh
DESTDIR=$1
# apache (httpd)
_p1='s|/usr/sbin/apache2|/usr/sbin/apachectl|'
_p2='s|/etc/apache2/httpd.conf|/etc/httpd/httpd.conf|'
if [ "$(uname -m)" = x86_64 ]; then
_p4='s|/usr/lib/apache2|/usr/lib64/httpd|'
else
_p4='s|/usr/lib/apache2|/usr/lib/httpd|'
fi
_p5='s|apache2.pid|httpd.pid|'
_p6='s|apache2 >/dev/null|httpd >/dev/null|'
_p7='s|apache2|httpd|g'
_p8='s|/run/apache_ssl_mutex|/run/httpd|'
sed -e "${_p1}" -e "${_p2}" -e "${_p4}" -e "${_p5}" -e "${_p6}" -e "${_p8}" -i "${DESTDIR}/etc/init.d/httpd"
sed -e "${_p2}" -e "${_p4}" -e "${_p5}" -e "${_p7}" -i "${DESTDIR}/etc/conf.d/httpd"
# named
_p1='s|/etc/bind/named.conf|/etc/named.conf|g'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/named"
# hostapd
sed -e "s|INTERFACES=|#INTERFACES=|" -i "${DESTDIR}/etc/conf.d/hostapd"
# iptables
_p1='s|/sbin/${iptables_name}|/usr/sbin/${iptables_name}|g'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/iptables"
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/ip6tables"
# proftpd
_p1='s|/etc/proftpd|/etc|g'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/proftpd"
# saslauthd
_p1='s|-a pam|-a shadow|'
sed -e "${_p1}" -i "${DESTDIR}/etc/conf.d/saslauthd"
# vsftpd
_p1='s|/etc/vsftpd|/etc|g'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/vsftpd"
#!/bin/sh
# fix_openrc_slack.sh
DESTDIR=$1
# ulogd
_p1='s| --pidfile ${ULOGD_PIDFILE}||g'
_p2='s| --uid ulogd||g'
sed -e "${_p1}" -e "${_p2}" -i "${DESTDIR}/etc/init.d/ulogd"
#!/bin/sh
# fix_openrc_video.sh
DESTDIR=$1
# nvidia
_p1='s|/opt/bin/nvidia-smi|/usr/bin/nvidia-smi|g'
_p2='s|/opt/bin/nvidia-persistenced|/usr/bin/nvidia-persistenced|g'
sed -e "${_p1}" -i "${DESTDIR}/etc/init.d/nvidia-smi"
sed -e "${_p2}" -i "${DESTDIR}/etc/init.d/nvidia-persistenced"
#!/bin/sh
# fix_path.sh: fixes path in runscript and location of /var/run
DESTDIR=$1
_shebang='s|#!/sbin/runscript|#!/sbin/openrc-run|'
_runpath='s|/var/run|/run|g'
for file in ${DESTDIR}/etc/init.d/*; do
sed -e "${_shebang}" -e "${_runpath}" -i "$file"
done
for file in ${DESTDIR}/etc/conf.d/*; do
sed -e "${_runpath}" -i "$file"
done
#!/bin/bash
# functions.sh
# Called after sourcing the PKGBUILD, such that the source array is declared.
download_source() {
for file in ${source[@]}; do
# Check if file is a link or not
echo ${file} | grep -q http
[ $? -ne 0 ] && return 1
# Get the actual file name
filename=${file#*::}
wget -Nc $filename
done
}
# Config file for /etc/init.d/sysklogd
SYSLOGD="-m 0"
# send warnings and above to the console
KLOGD="-c 3 -2"
/var/log/auth.log /var/log/daemon.log /var/log/debug /var/log/kern.log /var/log/lpr.log /var/log/mail.err /var/log/mail.info /var/log/mail.log /var/log/mail.warn /var/log/messages /var/log/news/news.crit /var/log/news/news.err /var/log/news/news.notice /var/log/syslog /var/log/user.log {
create 640 root root
sharedscripts
missingok
postrotate
/etc/init.d/sysklogd -q reload
endscript
}
#!/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/app-admin/sysklogd/files/sysklogd.rc7,v 1.1 2011/09/14 22:22:57 polynomial-c Exp $
extra_started_commands="reload"
depend() {
need clock hostname
provide logger
}
start_daemon() {
local retval=0
local daemon="$1"
local options="$2"
[ -z "${daemon}" ] && return 1
ebegin "sysklogd -> start: ${daemon}"
start-stop-daemon --start --exec /usr/sbin/"${daemon}" \
--pidfile /var/run/"${daemon}".pid -- ${options}
retval=$?
eend ${retval} "Failed to start ${daemon}"
return ${retval}
}
stop_daemon() {
local retval=0
local daemon="$1"
[ -z "${daemon}" ] && return 1
ebegin "sysklogd -> stop: ${daemon}"
# syslogd can be stubborn some times (--retry 15)...
start-stop-daemon --stop --retry 15 --quiet --pidfile /var/run/"${daemon}".pid
retval=$?
eend ${retval} "Failed to stop ${daemon}"
return ${retval}
}
start() {
start_daemon "syslogd" "${SYSLOGD}" || return 1
# klogd do not always start proper if started too early
sleep 1
if ! start_daemon "klogd" "${KLOGD}" ; then
stop_daemon "syslogd"
return 1
fi
return 0
}
stop() {
stop_daemon "klogd" || return 1
stop_daemon "syslogd" || return 1
return 0
}
reload() {
local ret=0
ebegin "Reloading configuration"
start-stop-daemon --signal HUP --pidfile /var/run/syslogd.pid
ret=$((${ret} + $?))
start-stop-daemon --signal USR1 --pidfile /var/run/klogd.pid
ret=$((${ret} + $?))
eend ${ret}
}
#!/sbin/runscript
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/ulogd/files/ulogd.init,v 1.1 2015/05/30 09:38:29 idella4 Exp $
extra_started_commands="reload reopen"
: ${ULOGD_BINARY:=/usr/sbin/ulogd}
: ${ULOGD_PIDFILE:=/run/${SVCNAME}.pid}
: ${ULOGD_OPTS:=--daemon --uid ulogd --pidfile ${ULOGD_PIDFILE}}
depend() {
before iptables ip6tables ebtables firewall
after mysql postgresql
}
start() {
ebegin "Starting ${SVCNAME}"
start-stop-daemon --start \
--exec ${ULOGD_BINARY} --pidfile ${ULOGD_PIDFILE} \
-- ${ULOGD_OPTS}
eend $?
}
stop() {
ebegin "Stopping ${SVCNAME}"
start-stop-daemon --stop --pidfile ${ULOGD_PIDFILE}
eend $?
}
reload() {
ebegin "Reloading ${SVCNAME} configuration"
start-stop-daemon --signal USR1 --pidfile ${ULOGD_PIDFILE}
eend $?
}
reopen() {
ebegin "Reopening ${SVCNAME} logfiles"
start-stop-daemon --signal HUP --pidfile ${ULOGD_PIDFILE}
eend $?
}
/var/log/ulogd/*.log {
sharedscripts
missingok
notifempty
create 0640 ulogd
postrotate
[ -f /run/ulogd.pid ] && /bin/kill -HUP $(cat /run/ulogd.pid)
endscript
}
[Unit]
Description=A userspace logging daemon for netfilter/iptables related logging
Before=iptables.service ip6tables.service
After=mysql.service postgresql.service
[Service]
Type=forking
PIDFile=/run/ulogd.pid
ExecStart=/usr/sbin/ulogd --daemon --uid ulogd --pidfile /run/ulogd.pid
ExecReload=/bin/kill -USR1 $MAINPID
[Install]
WantedBy=network.target
4-Nov-2000
Note: this file has been modified to adapt to Gentoo specific.
class files are installed in
`java-config -p cyrus-sasl-2`
to compile programs using it, do:
javac -classpath $JAVA_HOME/lib/tools.jar:`java-config -p cyrus-sasl-2` <file>.java
(make sure to substitute your JDK for $JAVA_HOME/lib/tools.jar)
to run, do
java -classpath <same path as above> <YourProgram>
----------------------------
This is a java version of the SASL libraries. It supports all the
mechanisms in the C version and conforms to the internet draft in the
doc/ directory. JNI is used.
Sample applications exist in the Test/ directory.
They generally can be run with something like:
java -debug -classpath
../:$JAVA_HOME/lib/tools.jar:`java-config -p cyrus-sasl-2`:. jimtest -p 2143 -m
KERBEROS_V4 cyrus-dev
and
java -debug -classpath
../:$JAVA_HOME/lib/tools.jar:`java-config -p cyrus-sasl-2`:. testserver
Any feedback is welcome.
#!/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/cyrus-sasl/files/pwcheck.rc6,v 1.6 2011/08/05 07:21:46 eras Exp $
depend() {
need localmount
use logger
}
start() {
ebegin "Starting sasl pwcheck daemon"
start-stop-daemon --start --quiet --exec /usr/sbin/pwcheck
eend $?
}
stop() {
ebegin "Stopping sasl pwcheck daemon"
start-stop-daemon --stop --quiet --exec /usr/sbin/pwcheck
eend $?
}
[Unit]
Description=SASL pwcheck daemon
[Service]
Type=forking
ExecStart=/usr/sbin/pwcheck
[Install]
WantedBy=multi-user.target