blob: c0c5478a65c234420831b355188bfc205031945f (
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
|
--- Makefile- 2014-04-17 19:12:52.415410443 +0300
+++ Makefile 2014-04-17 19:13:19.979613470 +0300
@@ -1,7 +1,8 @@
### Edit this:
-INSTALL_PATH=/usr/local/rejik3
-SQUID_USER=squid
-SQUID_GROUP=squid
+INSTALL_PATH=/var/lib/rejik
+DSTDIR_PATH=${DSTDIR}${INSTALL_PATH}
+SQUID_USER=nobody
+SQUID_GROUP=nogroup
CC=gcc -Wall
INCLUDE=-I/usr/include -I/usr/local/include -I/usr/include/pcre
@@ -40,36 +41,38 @@
install:
# Make dirs
- mkdir -p ${INSTALL_PATH}/tools
+ mkdir -p ${DSTDIR_PATH}/tools
+ mkdir -p ${DSTDIR}/etc/squid
+ mkdir -p ${DSTDIR}/var/log/squid/rejik
# Install redirector
- cp make-cache ${INSTALL_PATH}
- cp redirector ${INSTALL_PATH}
- cp redirector.conf.dist ${INSTALL_PATH}
+ cp make-cache ${DSTDIR_PATH}
+ cp redirector ${DSTDIR_PATH}
+ cp redirector.conf.dist ${DSTDIR}/etc/squid
# Install tools
- echo "#!/bin/sh" > ${INSTALL_PATH}/tools/check-redirector
- echo 'su ${SQUID_USER} -c "echo \"http://sex.ru 127.0.0.1/- - GET\" | ${INSTALL_PATH}/redirector ${INSTALL_PATH}/redirector.conf;"' >> ${INSTALL_PATH}/tools/check-redirector
- chmod 755 ${INSTALL_PATH}/tools/check-redirector
+ echo "#!/bin/sh" > ${DSTDIR_PATH}/tools/check-redirector
+ echo 'su ${SQUID_USER} -c "echo \"http://sex.ru 127.0.0.1/- - GET\" | ${INSTALL_PATH}/redirector ${INSTALL_PATH}/redirector.conf;"' >> ${DSTDIR_PATH}/tools/check-redirector
+ chmod 755 ${DSTDIR_PATH}/tools/check-redirector
- echo "#!/bin/sh" > ${INSTALL_PATH}/tools/set-permissions
- echo 'chown -R ${SQUID_USER}:${SQUID_GROUP} ${INSTALL_PATH}' >> ${INSTALL_PATH}/tools/set-permissions
- chmod 755 ${INSTALL_PATH}/tools/set-permissions
+ echo "#!/bin/sh" > ${DSTDIR_PATH}/tools/set-permissions
+ echo 'chown -R ${SQUID_USER}:${SQUID_GROUP} ${INSTALL_PATH}' >> ${DSTDIR_PATH}/tools/set-permissions
+ chmod 755 ${DSTDIR_PATH}/tools/set-permissions
- cp tools/kill-cache ${INSTALL_PATH}/tools
- chmod 755 ${INSTALL_PATH}/tools/kill-cache
+ cp tools/kill-cache ${DSTDIR_PATH}/tools
+ chmod 755 ${DSTDIR_PATH}/tools/kill-cache
- cp tools/benchmark ${INSTALL_PATH}/tools
- chmod 755 ${INSTALL_PATH}/tools/benchmark
+ cp tools/benchmark ${DSTDIR_PATH}/tools
+ chmod 755 ${DSTDIR_PATH}/tools/benchmark
- cp tools/IN.gz ${INSTALL_PATH}/tools
- chmod 644 ${INSTALL_PATH}/tools/IN.gz
+ cp tools/IN.gz ${DSTDIR_PATH}/tools
+ chmod 644 ${DSTDIR_PATH}/tools/IN.gz
# Set permissions
- chown -R ${SQUID_USER}:${SQUID_GROUP} ${INSTALL_PATH}
- chmod 770 ${INSTALL_PATH}
- chmod 644 ${INSTALL_PATH}/redirector.conf.dist
- chmod 755 ${INSTALL_PATH}/redirector
- chmod 755 ${INSTALL_PATH}/make-cache
+ chown -R ${SQUID_USER}:${SQUID_GROUP} ${DSTDIR_PATH} ${DSTDIR} ${DSTDIR}/var/log/squid/rejik
+ chmod 770 ${DSTDIR_PATH}
+ chmod 644 ${DSTDIR}/etc/squid/redirector.conf.dist
+ chmod 755 ${DSTDIR_PATH}/redirector
+ chmod 755 ${DSTDIR_PATH}/make-cache
|