summaryrefslogtreecommitdiff
path: root/homebrew/aiccu/patches.sh
diff options
context:
space:
mode:
authorMCApollo <34170230+MCApollo@users.noreply.github.com>2019-04-20 20:49:46 -0500
committerMCApollo <34170230+MCApollo@users.noreply.github.com>2019-04-23 20:18:47 -0500
commit12335518ab39608d58370c85ff9f5384ad2aa5f7 (patch)
tree352d81f2a2de3f1252af732080ec0fde38c13b4d /homebrew/aiccu/patches.sh
parenta2b26ad12d4fa12f0273645caf4be6d0b8b71e7c (diff)
Ported in the homebrew-marauder for a hacky update/import system.
TODO: Maybe add a license & fix up messy code.
Diffstat (limited to 'homebrew/aiccu/patches.sh')
-rwxr-xr-xhomebrew/aiccu/patches.sh72
1 files changed, 72 insertions, 0 deletions
diff --git a/homebrew/aiccu/patches.sh b/homebrew/aiccu/patches.sh
new file mode 100755
index 000000000..9b9a3defa
--- /dev/null
+++ b/homebrew/aiccu/patches.sh
@@ -0,0 +1,72 @@
+echo 'Creating brew-patch.diff'
+cat << EOF >> brew-patch.diff
+diff --git a/Makefile b/Makefile
+index 0e96136..78609bd 100644
+--- a/Makefile
++++ b/Makefile
+@@ -36,10 +36,11 @@ export DESTDIR
+ CFLAGS=${RPM_OPT_FLAGS}
+
+ # Destination Paths (relative to DESTDIR)
+-dirsbin=/usr/sbin/
+-dirbin=/usr/bin/
+-diretc=/etc/
+-dirdoc=/usr/share/doc/${PROJECT}/
++prefix=
++dirsbin=${prefix}/sbin/
++dirbin=${prefix}/bin/
++diretc=${prefix}/etc/
++dirdoc=${prefix}/share/doc/${PROJECT}/
+
+ # Make sure the lower makefile also knows these
+ export PROJECT
+@@ -79,21 +80,13 @@ install: aiccu
+ @echo "Configuration..."
+ @mkdir -p ${DESTDIR}${diretc}
+ ifeq ($(shell echo "A${RPM_BUILD_ROOT}"),A)
+- $(shell [ -f ${DESTDIR}${diretc}${PROJECT}.conf ] || cp -R doc/${PROJECT}.conf ${DESTDIR}${diretc}${PROJECT}.conf)
+ @echo "Documentation..."
++ @cp doc/${PROJECT}.conf ${DESTDIR}${dirdoc}
+ @cp doc/README ${DESTDIR}${dirdoc}
+ @cp doc/LICENSE ${DESTDIR}${dirdoc}
+ @cp doc/HOWTO ${DESTDIR}${dirdoc}
+- @echo "Installing Debian-style init.d"
+- @mkdir -p ${DESTDIR}${diretc}init.d
+- @cp doc/${PROJECT}.init.debian ${DESTDIR}${diretc}init.d/${PROJECT}
+-else
+- @echo "Installing Redhat-style init.d"
+- @mkdir -p ${DESTDIR}${diretc}init.d
+- @cp doc/${PROJECT}.init.rpm ${DESTDIR}${diretc}init.d/${PROJECT}
+- @cp doc/${PROJECT}.conf ${DESTDIR}${diretc}${PROJECT}.conf
+ endif
+- @echo "Installation into ${DESTDIR}/ completed"
++ @echo "Installation into ${DESTDIR}${prefix}/ completed"
+
+ help:
+ @echo "$(PROJECT) - $(PROJECT_DESC)"
+diff --git a/common/aiccu.h b/common/aiccu.h
+index ef65000..5b2eb43 100755
+--- a/common/aiccu.h
++++ b/common/aiccu.h
+@@ -65,17 +65,17 @@
+ * the data. Could be useful in the event
+ * where we can't make contact to the main server
+ */
+-#define AICCU_CACHE "/var/cache/aiccu.cache"
++#define AICCU_CACHE "HOMEBREW_PREFIX/var/cache/aiccu.cache"
+
+ /* The PID we are running as when daemonized */
+-#define AICCU_PID "/var/run/aiccu.pid"
++#define AICCU_PID "HOMEBREW_PREFIX/var/run/aiccu.pid"
+
+ /* AICCU Configuration file */
+ #ifdef _WIN32
+ /* GetWindowsDirectory() is used to figure out the directory to store the config */
+ #define AICCU_CONFIG "aiccu.conf"
+ #else
+-#define AICCU_CONFIG "/etc/aiccu.conf"
++#define AICCU_CONFIG "HOMEBREW_PREFIX/etc/aiccu.conf"
+ #endif
+
+ /* Inbound listen queue */
+EOF