10000 Add archlinux & opensuse scripts · lcppcl/code@229e124 · GitHub
[go: up one dir, main page]

Skip to content

Commit 229e124

Browse files
committed
Add archlinux & opensuse scripts
1 parent 96351d2 commit 229e124

File tree

5 files changed

+62
-2
lines changed

5 files changed

+62
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Currently supports the following systems:
1717
* gentoo
1818
* ubuntu/debian
1919
* centos/redhat/fedora
20+
* opensuse
21+
* archlinux
22+
23+
You only to excute:
2024

2125
```
2226
bash <(curl -s https://raw.github.com/douban/code/master/scripts/install_code.sh)

scripts/archlinux.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
#Get generic function
4+
. common.sh
5+
6+
echo "Install needed package.This may take some time..."
7+
sudo pacman -S git gcc make python2-pip python2-virtualenv memcached git --noconfirm -q
8+
9+
echo "Install mysql..."
10+
sudo pacman -S mysql --noconfirm -q
11+
sudo systemctl start mysqld
12+
13+
echo "Setup memcached port to 11311..."
14+
sudo sed -i "s/memcached -l/memcached -p 11311 -l/" /usr/lib/systemd/system/memcached.service
15+
sudo systemctl start memcached
16+
17+
echo "Install libmemcached..."
18+
install_libmemcached
19+
20+
# Use virtualenv2
21+
sudo mv /usr/bin/virtualenv /usr/bin/virtualenv.bak
22+
sudo ln -s /usr/bin/virtualenv2 /usr/bin/virtualenv
23+
24+
echo "Install code..."
25+
install_code
26+
27+
echo "Start app..."
28+
start_app

scripts/common.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ install_code() {
4646
. venv/bin/activate
4747
pip install cython # should install first
4848
pip install -U setuptools # python-libmemcached require updated setuptools
49+
pip install "distribute==0.6.29" # Fixed install MySQL-python for #14
4950
pip install -r requirements.txt
5051
}
5152

scripts/install_code.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
url='https://raw.github.com/dongweiming/code/master/scripts'
3+
url='https://raw.github.com/douban/code/master/scripts'
44

55
if [ -f /etc/fedora-release ] ; then
66
file="$url/fedora.sh"
@@ -12,8 +12,10 @@ elif [ -f /etc/debian_version ] ; then
1212
file="$url/ubuntu.sh"
1313
elif [ -f /etc/gentoo-release ] ; then
1414
file="$url/gentoo.sh"
15+
elif [ -f /etc/arch-release ] ; then
16+
file="$url/archlinux.sh"
1517
else
16-
echo "Do not support the system!"
18+
echo "Not yet support the system!"
1719
exit 1
1820
fi
1921

scripts/opensuse.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
#Get generic function
4+
. common.sh
5+
6+
echo "Install needed package.This may take some time..."
7+
sudo zypper -nq install gcc gcc-c++ python-pip python-virtualenv git memcached python-devel make
8+
9+
echo "Install mysql..."
10+
# After 12.3 mysql is mariadb
11+
sudo zypper -nq install mysql libmysqlclient-devel
12+
sudo /sbin/service mysql start
13+
14+
echo "Setup memcached port to 11311..."
15+
sudo sed -i 's/MEMCACHED_PARAMS=\"/MEMCACHED_PARAMS=\"-p 11311 /' /etc/sysconfig/memcached
16+
sudo /etc/init.d/memcached restart
17+
18+
echo "Install libmemcached..."
19+
install_libmemcached
20+
21+
echo "Install code..."
22+
install_code
23+
24+
echo "Start app..."
25+
start_app

0 commit comments

Comments
 (0)
0