Move module templates to DATADIR

The file hierarchy standard wants that!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1982 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-05-13 16:51:17 +00:00
parent 8e8463092b
commit 10d1fa41a9
4 changed files with 14 additions and 6 deletions
+3 -1
View File
@@ -19,6 +19,7 @@ LIBS := @LIBS@
LIBZNC := @LIBZNC@
LIBZNCDIR:= @LIBZNCDIR@
MODDIR := @MODDIR@
DATADIR := @DATADIR@
PKGCONFIGDIR := $(libdir)/pkgconfig
LIB_SRCS := ZNCString.cpp Csocket.cpp znc.cpp User.cpp IRCSock.cpp Client.cpp DCCBounce.cpp \
@@ -72,7 +73,8 @@ install: znc $(LIBZNC)
mkdir -p $(DESTDIR)$(includedir)/znc
mkdir -p $(DESTDIR)$(PKGCONFIGDIR)
mkdir -p $(DESTDIR)$(MODDIR)
cp -Rp webskins $(DESTDIR)$(MODDIR)
mkdir -p $(DESTDIR)$(DATADIR)
cp -Rp webskins $(DESTDIR)$(DATADIR)
install -m 0755 znc $(DESTDIR)$(bindir)
install -m 0755 znc-config $(DESTDIR)$(bindir)
install -m 0755 znc-buildmod $(DESTDIR)$(bindir)
+6
View File
@@ -454,6 +454,12 @@ CString CWebSock::GetModWebPath(const CModule* pModule) const {
// ...and set sModDir to the dir in which sModPath resides
CString sModDir = sModPath.substr(0, pos);
// Check if module is loaded from ~/.znc/modules or from source or from installed prefix
if (sModDir.Equals(_MODDIR_)) {
// Loaded from installed prefix
return CString(_DATADIR_) + "/www/" + pModule->GetModName();
}
return sModDir + "/www/" + pModule->GetModName();
}
+4 -4
View File
@@ -24,14 +24,14 @@
#define _MODDIR_ "/usr/lib/znc"
#endif
#ifndef _SKINDIR_
#define _SKINDIR_ _MODDIR_ "/webskins"
#endif
#ifndef _DATADIR_
#define _DATADIR_ "/usr/share/znc"
#endif
#ifndef _SKINDIR_
#define _SKINDIR_ _DATADIR_ "/webskins"
#endif
#define MODULECALL(macFUNC, macUSER, macCLIENT, macEXITER) \
if (macUSER) { \
CGlobalModules& GMods = CZNC::Get().GetModules(); \
+1 -1
View File
@@ -92,7 +92,7 @@ create_install_dir:
rm -rf $(DESTDIR)$(MODDIR)/*.so
install_metadirs: create_install_dir
cp -Rp $(srcdir)/www $(DESTDIR)$(MODDIR)
cp -Rp $(srcdir)/www $(DESTDIR)$(DATADIR)
for a in $(srcdir)/*; do \
d=$$(echo $$a | sed -e "s:$(srcdir)/::g"); \
if [ -d $$a ] && [ -f $${d}.so ]; then \