Commit 686fbc9a authored by Bob Mottram's avatar Bob Mottram

Initial

parents

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

This diff is collapsed.
APP=gnusocial
VERSION='1.2.0'
RELEASE='beta3'
ARCH_TYPE='all'
PREFIX?=/etc
all:
debug:
sync:
./upstream-to-debian.sh
source:
tar -cvf ../${APP}_${VERSION}.orig.tar ../${APP}-${VERSION} --exclude-vcs
gzip -f9n ../${APP}_${VERSION}.orig.tar
install:
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/${APP}
cp -r src/* ${DESTDIR}${PREFIX}/share/${APP}
cp -r webservers ${DESTDIR}${PREFIX}/share/${APP}
uninstall:
rm -rf ${PREFIX}/share/${APP}
if [ -L /etc/nginx/sites-enabled/${APP} ]; then \
rm -f /etc/nginx/sites-enabled/${APP}; \
fi
if [ -f /etc/nginx/sites-available/${APP} ]; then \
rm /etc/nginx/sites-available/${APP}; \
fi
if [ -d /etc/apache2 ]; then \
a2dissite ${APP}; \
rm /etc/apache2/sites-available/${APP}; \
fi
if [ -d /var/www/${APP} ]; then \
rm /var/www/${APP}; \
fi
clean:
rm -f \#* \.#* debian/*.substvars debian/*.log debian/gnusocial*
rm -rf deb.* debian/${APP}
rm -f ../${APP}*.deb ../${APP}*.changes ../${APP}*.asc ../${APP}*.dsc
GNU Social package for Debian
=============================
Also see the package for the Qvitter plugin at https://git.gnu.io:bashrc/gnusocial-qvitter-debian
Current build
-------------
Version: 1.2.0
Release: beta3
Upstream commit: 771f08b3c761ff122c3fff7bdb13ec6625828018
Updating
--------
If you need to update the package to a new version then edit the above version/commit and debian/changelog then run:
./debian.sh
Creating the package
--------------------
Run the debian.sh script to generate the package.
sudo apt-get install build-essential lintian python-software-properties debconf-utils software-properties-common
git clone git@git.gnu.io:bashrc/gnusocial-debian.git
cd gnusocial-debian
./debian.sh
Installation
------------
To ensure that the database gets created set the following before installing the package:
GNUSOCIAL_DOMAIN_NAME='your domain name'
GNUSOCIAL_ADMIN_PASSWORD='your admin user password for the gnusocial database'
MARIADB_ROOT_PASSWORD='Your password goes here'
sudo debconf-set-selections <<< "mariadb-server mariadb-server/root_password password $MARIADB_ROOT_PASSWORD"
sudo debconf-set-selections <<< "mariadb-server mariadb-server/root_password_again password $MARIADB_ROOT_PASSWORD"
sudo debconf-set-selections <<< "gnusocial gnusocial/domain string $GNUSOCIAL_DOMAIN_NAME"
sudo debconf-set-selections <<< "gnusocial gnusocial/admin_password password $GNUSOCIAL_ADMIN_PASSWORD"
Install your preferred web server:
sudo apt-get install nginx
or
sudo apt-get install apache2
Then to install:
sudo apt-get install eatmydata libjbig0 libterm-readkey-perl libtiff5 libaio1 mariadb-server-10.0 php-gettext php-openid php5 php5-cli php5-curl php5-gd php-db php-mail php-mail-mimedecode php-http-request2 php5-fpm php-auth-sasl php-net-ldap2 php-net-smtp php-net-socket php-net-url2 php-pear php-validate php5-gmp php5-intl php5-json php5-mysql php5-stomp libmarkdown-php libjs-jquery-cookie libjs-jquery-form libjs-jquery-ui libjs-jquery fonts-font-awesome git curl php-xml-parser libcurl3 php-mail-mime libgd3 libjpeg62-turbo libxpm4
sudo eatmydata dpkg -i ../gnusocial_*.deb
By default gnusocial will be installed to **/etc/share/gnusocial** and linked to **/var/www/gnusocial**.
Web host examples will be created within **/etc/apache2/sites-available** or **/etc/nginx/sites-available**, but they're not enabled. You can use that as a guide to how to integrate gnusocial with your system.
To obtain a Let's Encrypt certificate for your domain name:
sudo su
cd ~/
git clone https://github.com/letsencrypt/letsencrypt
systemctl stop nginx/apache2
cd ~/letsencrypt
./letsencrypt-auto certonly --server https://acme-v01.api.letsencrypt.org/directory --standalone -d <domain name> --renew-by-default --agree-tos --email <your email address>
systemctl start nginx/apache2
exit
If you also want an onion address:
sudo su
apt-get install tor
echo 'HiddenServiceDir /var/lib/tor/hidden_service_gnusocial' >> /etc/tor/torrc
echo 'HiddenServicePort 80 127.0.0.1:8087' >> /etc/tor/torrc
systemctl stop tor
systemctl start tor
echo "GNU Social onion address: $(cat /var/lib/tor/hidden_service_gnusocial/hostname)"
exit
Then if you're using nginx append this to the end of to your */etc/nginx/sites-available/gnusocial* file:
``` bash
server {
listen 127.0.0.1:8087 default_server;
server_name gnusocial.example;
# Logs
access_log off;
error_log off;
# Root
root /etc/share/gnusocial;
# Index
index index.php;
# PHP
location ~ \.php {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
# Location
location / {
try_files $uri $uri/ @gnusocial;
}
# Fancy URLs
location @gnusocial {
rewrite ^(.*)$ /index.php?p=$1 last;
}
# Restrict access that is unnecessary anyway
location ~ /\.(ht|git) {
deny all;
}
client_max_body_size 15m;
}
```
To enable your site:
sudo ln -s /etc/nginx/sites-available/gnusocial /etc/nginx/sites-enabled/
sudo rm /etc/nginx/sites-enabled/default
sudo systemctl restart nginx
sudo systemctl restart php5-fpm
or for Apache:
sudo a2ensite gnusocial
sudo systemctl restart apache2
Then in a browser navigate to your domain name or your onion address in a Tor compatible browser.
To set up your GNU Social site:
* Set a name for the site
* Server SSL: enable
* Hostname: localhost
* Type: MySql/MariaDB
* Name: gnusocial
* DB username: root
* DB Password; *[MariaDB root password]*
* Administrator nickname: *[your username]*
* Administrator password: *[your admin user password for the gnusocial database]*
* Subscribe to announcements: ticked
* Site profile: Community
When the install is complete you will see a lot of warnings but just ignore those and navigate to your domain name (or onion address) and you can then complete the configuration via the *Admin* section on the header bar.
#!/bin/bash
SOURCE_FILE='README.md'
APP=gnusocial
PREV_VERSION=1.2.0
VERSION=$(cat $SOURCE_FILE | grep 'Version:' | head -n 1 | awk -F ':' '{print $2}' | sed -e 's/^[ \t]*//')
RELEASE=$(cat $SOURCE_FILE | grep 'Release:' | head -n 1 | awk -F ':' '{print $2}' | sed -e 's/^[ \t]*//')
GNUSOCIAL_COMMIT=$(cat $SOURCE_FILE | grep 'Upstream commit:' | head -n 1 | awk -F ':' '{print $2}' | sed -e 's/^[ \t]*//')
ARCH_TYPE='all'
DIR=${APP}-${VERSION}
export DH_ALWAYS_EXCLUDE=.git
# Update version numbers automatically - so you don't have to
sed -i "s/VERSION=.*/VERSION='${VERSION}'/g" Makefile
sed -i "s/RELEASE=.*/RELEASE='${RELEASE}'/g" Makefile
sed -i "0,/RE/s/GNUSOCIAL_COMMIT=.*/GNUSOCIAL_COMMIT='${GNUSOCIAL_COMMIT}'/" upstream-to-debian.sh
sed -i "s/-'${PREV_VERSION}'.so/-'${VERSION}'.so/g" debian/*.links
if ! grep -q "$VERSION" debian/changelog; then
echo "Edit debian/changelog and add version $VERSION-$RELEASE at the top"
exit 1
fi
./upstream-to-debian.sh
make clean
make
if [ ! "$?" = "0" ]; then
exit 1
fi
# change the parent directory name to debian format
mv ../${APP}-debian ../${DIR}
# Create a source archive
make source
if [ ! "$?" = "0" ]; then
mv ../${DIR} ../${APP}-debian
exit 2
fi
# Build the package
dpkg-buildpackage -i -F
if [ ! "$?" = "0" ]; then
mv ../${DIR} ../${APP}-debian
exit 3
fi
# sign files
#gpg -ba ../${APP}_${VERSION}-1_${ARCH_TYPE}.deb
#gpg -ba ../${APP}_${VERSION}.orig.tar.gz
# restore the parent directory name
mv ../${DIR} ../${APP}-debian
if [ ! -f ../${APP}_${VERSION}-${RELEASE}_all.deb ]; then
echo "Failed to build ../${APP}_${VERSION}-${RELEASE}_all.deb"
exit 1
fi
echo 'Running lintian checks...'
lintian ../${APP}_${VERSION}-${RELEASE}_all.deb
echo 'Build complete'
exit 0
gnusocial (1.2.0-beta3) unstable; urgency=low
* Initial release
-- Bob Mottram <bob.mottram@codethink.co.uk> Fri, 22 Jan 2016 20:14:00 +0100
debian/compat 0 → 100644