Commit f6ab2931 authored by Robert Gobeille's avatar Robert Gobeille

rearrange for new install/ and packaging/


git-svn-id: http://svn.code.sf.net/p/fossology/code/branches/fossology2.0/fossology@4976 a5643f74-2041-0410-a2b9-94ffef304a07
parent baed44f1
# FOSSology Makefile - common/
# Copyright (C) 2008 Hewlett-Packard Development Company, L.P.
TOP=..
VARS=$(TOP)/Makefile.conf
DEPS=$(TOP)/Makefile.deps
include $(VARS)
CONFPATH=$(SYSCONFDIR)
all: fo-postinstall defconf/Db.conf defconf/fossology.conf
# include the preprocessing stuff
include $(TOP)/Makefile.process
# generate the postinstall script
fo-postinstall: fo-postinstall-process
chmod +x fo-postinstall
# generate the default Db.conf file
defconf/Db.conf: defconf/Db.conf-process
# generate fossology.conf
defconf/fossology.conf: defconf/fossology.conf-process
install: all
$(INSTALL_PROGRAM) fo-postinstall $(DESTDIR)$(LIBEXECDIR)/fo-postinstall
echo "Making configuration directories"; \
if [ ! -e $(DESTDIR)$(CONFPATH) ] ; then \
mkdir -p $(DESTDIR)$(CONFPATH); \
fi
if [ ! -e $(DESTDIR)$(CONFPATH)/mods-enabled ] ; then \
mkdir -p $(DESTDIR)$(CONFPATH)/mods-enabled; \
/bin/chmod 775 $(DESTDIR)$(CONFPATH)/mods-enabled; \
fi
echo "Installing configuration files..."
if [ ! -f $(DESTDIR)$(CONFPATH)/Db.conf -o "$(OVERWRITE)" ] ; then \
echo "NOTE: using default version for $(DESTDIR)$(CONFPATH)/Db.conf"; \
$(INSTALL) -m 640 defconf/Db.conf $(DESTDIR)$(CONFPATH)/Db.conf; \
else \
echo "WARNING: $(DESTDIR)$(CONFPATH)/Db.conf already exists."; \
echo " Not overwriting, consider checking it by hand or use the OVERWRITE option."; \
fi \
if [ ! -f $(DESTDIR)$(CONFPATH)/fossology.conf -o "$(OVERWRITE)"]; then \
echo "NOTE: using default version for $(DESTDIR)$(CONFPATH)/fossology.conf"; \
$(INSTALL) -m 666 defconf/fossology.conf $(DESTDIR)$(CONFPATH)/fossology.conf; \
else \
echo "WARNING: $(DESTDIR)$(CONFPATH)/fossology.conf already exists."; \
echo " Not overwriting, consider checking it by hand or use the OVERWRITE option."; \
fi \
uninstall:
rm -f $(DESTDIR)$(LIBEXECDIR)/fo-postinstall
@if [ -d $(DESTDIR)$(LIBEXECDIR) ]; then \
if [ "`ls -A $(DESTDIR)$(LIBEXECDIR)`" ]; then \
echo "WARNING: $(DESTDIR)$(LIBEXECDIR) not empty, not removing";\
else \
rmdir $(DESTDIR)$(LIBEXECDIR); \
fi; \
fi
@echo "WARNING: Cowardly refusing to remove the following"
@echo " $(DESTDIR)$(CONFPATH)/agents.d"
@echo " $(DESTDIR)$(CONFPATH)/fossology.conf"
@echo " $(DESTDIR)$(CONFPATH)/Db.conf"
@echo " Remove by hand if you desire."
clean:
rm -f fo-postinstall defconf/Db.conf
test: all
@echo "NOTICE: no tests available for common"
coverage:
@echo "NOTICE: no coverage available for common""
.PHONY: all install uninstall clean test
# FOSSology Makefile - db/
# Copyright (C) 2008 Hewlett-Packard Development Company, L.P.
TOP=..
VARS=$(TOP)/Makefile.conf
DEPS=$(TOP)/Makefile.deps
include $(VARS)
all: dbcreate
# include the preprocessing stuff
include $(TOP)/Makefile.process
# generate the dbcreate script
dbcreate: dbcreate-process
chmod +x dbcreate
install: all
$(INSTALL_DATA) fossologyinit.sql $(DESTDIR)$(LIBEXECDIR)/fossologyinit.sql
$(INSTALL_DATA) licenseref.sql $(DESTDIR)$(LIBEXECDIR)/licenseref.sql
$(INSTALL_PROGRAM) dbcreate $(DESTDIR)$(LIBEXECDIR)/dbcreate
@if [ ! -f "$(DESTDIR)/etc/cron.d/fossology" -o "$(OVERWRITE)" ]; then \
mkdir -p $(DESTDIR)/etc/cron.d/; \
echo "NOTE: using default version for $(DESTDIR)/etc/cron.d/fossology"; \
$(INSTALL_DATA) db.cron $(DESTDIR)/etc/cron.d/fossology; \
else \
echo "WARNING: $(DESTDIR)/etc/cron.d/fossology already exists."; \
echo " Not overwriting, consider checking it by hand or use the OVERWRITE option."; \
fi
uninstall:
rm -f $(DESTDIR)$(LIBEXECDIR)/fossologyinit.sql
rm -f $(DESTDIR)$(LIBEXECDIR)/licenseref.sql
rm -f $(DESTDIR)$(LIBEXECDIR)/dbcreate
@if [ -d $(DESTDIR)$(LIBEXECDIR) ]; then \
if [ "`ls -A $(DESTDIR)$(LIBEXECDIR)`" ]; then \
echo "WARNING: $(DESTDIR)$(LIBEXECDIR) not empty, not removing";\
else \
rmdir $(DESTDIR)$(LIBEXECDIR); \
fi; \
fi
@echo "WARNING: Cowardly refusing to remove the following"
@echo " $(DESTDIR)/etc/cron.d/fossology"
@echo " Remove by hand if you desire."
clean:
rm -f core dbcreate
test: all
@echo "NOTICE: no tests available for db"
coverage:
@echo "NOTICE: no coverage available for db"
.PHONY: all install uninstall clean test
# this cron should be run daily by user postgres for fossology database
#
# Copyright (C) 2007 Hewlett-Packard Development Company, L.P.
#
# cluster
#0 0 * * * if [ -x /usr/bin/clusterdb ]; then /usr/bin/clusterdb --username postgres fossology >/dev/null; fi
#
# Run VACUUM ANALYSE on all databases every 5 hours if pg_autovacuum is not
# running
#0 3 * * * if [ -x /usr/sbin/pg_maintenance ]; then /usr/sbin/pg_maintenance --full --analyze >/dev/null; fi
#!/bin/bash
# FOSSology dbcreate script
# Copyright (C) 2008 Hewlett-Packard Development Company, L.P.
#
# This script checks to see if the the fossology db exists and if not
# then creates it.
echo "*** Setting up the FOSSology database ***"
# At some point this is where we could dynamically set the db password
# first check that postgres is running
su postgres -c 'echo \\q|psql'
if [ $? != 0 ]; then
echo "ERROR: postgresql isn't running"
exit 1
fi
# then check to see if the db already exists
su postgres -c 'psql -l' |grep -q fossology
if [ $? = 0 ]; then
echo "NOTE: fossology database already exists, not creating"
echo "*** Checking for plpgsql support ***"
su postgres -c 'createlang -l fossology' |grep -q plpgsql
if [ $? = 0 ]; then
echo "NOTE: plpgsql already exists in fossology database, good"
else
echo "NOTE: plpgsql doesn't exist, adding"
su postgres -c 'createlang plpgsql fossology'
if [ $? != 0 ]; then
echo "ERROR: failed to add plpgsql to fossology database"
fi
fi
else
echo "*** Initializing database ***"
su postgres -c "psql < {$LIBEXECDIR}/fossologyinit.sql"
if [ $? != 0 ] ; then
echo "ERROR: Database failed during configuration.\n"
exit 1
fi
fi
create role fossy with createdb login password 'fossy';
--
-- PostgreSQL database dump
--
SET client_encoding = 'SQL_ASCII';
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: fossology; Type: DATABASE; Schema: -; Owner: fossy
--
CREATE DATABASE fossology WITH TEMPLATE = template0 ENCODING = 'SQL_ASCII';
ALTER DATABASE fossology OWNER TO fossy;
\connect fossology
CREATE LANGUAGE plpgsql;
SET client_encoding = 'SQL_ASCII';
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON SCHEMA public IS 'Standard public schema';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
This diff is collapsed.
dbname={$PROJECT};
host=localhost;
user={$PROJECTUSER};
password={$PROJECTUSER};
; basic Scheduer.conf for the version 2.0 of the scheduler
; this is a simple key-value configuration file
; should have two groups
; FOSSOLOGY: basic configurations
; HOSTS: a list of host used by fossology
; REPOSITORY: sets the repo information
[FOSSOLOGY]
port = 24693
address = localhost
; REPLACEMENT for Depth.conf
depth = 3
; REPLACEMENT for RepPath.conf
path = /srv/fossology/repository
; REPLACEMENT for Proxy.conf
; proxy settings that will be used by fossology agents
; examples:
;http_proxy = http://server:8080
;ftp_proxy = http://server:3128
;no_proxy = localhost,10.1.2.3
; REPLACEMENT for Hosts.conf
; set up the set of hosts available to analyze files. If there is an entry
; for localhost it will be read, if there isn't one then it is assumed that
; localhost cannot host any agents. A man of -1 does not indicate that a
; host can have as many agents running as necessary, (i.e. there should always
; be a max on the number of agents for a particular host).
[HOSTS]
localhost = localhost AGENT_DIR 10
[REPOSITORY]
localhost[] = * 00 ff
[DIRECTORIES]
; Project Name.
; Do not change after installation since PROJECT is used in installation directory names.
; Use PREFIX to install multiple copies of FOSSology.
PROJECT={$PROJECT}
; base of the program data tree
PREFIX={$PREFIX}
; executable programs that users run
BINDIR=$PREFIX/bin
; executable programs that sysadmins run
SBINDIR=$PREFIX/sbin
; object code libraries
LIBDIR=$PREFIX/lib
; header files
INCLUDEDIR=$PREFIX/include
; executables/libraries that only our project uses
LIBEXECDIR=$PREFIX/lib/$PROJECT
; non-arch-specific data
DATAROOTDIR=$PREFIX/share
; non-arch-dependent program data
MODDIR=$DATAROOTDIR/$PROJECT
; local state
LOCALSTATEDIR=/var/local
; project local state
PROJECTSTATEDIR=$LOCALSTATEDIR/lib/$PROJECT
; project logdir
LOGDIR=/var/log/$PROJECT
This diff is collapsed.
This rpm/ directory is meant to contain the files necessary for RPM packaging
of FOSSology for RPM-based systems including RHEL, CentOS, etc.
Initially this will contain the RPM spec file and any other supporting scripts
and may contain additional documentation and utilities as needed.
It is analogous to the debian/ directory, which serves this purpose for Debian
distro packaging.
#FOSSology releases
[fossology]
name=Fossology releases
baseurl=http://fossology.org/rpms/centos/$releasever/$basearch
enabled=1
gpgcheck=0
# FOSSology release candidates and other special builds
[fossology-testing]
name=Fossology testing
baseurl=http://fossology.org/rpms-testing/centos/$releasever/$basearch
enabled=0
gpgcheck=0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment