<name>SLC Distribution</name>
<modules>
<module>slc</module>
+ <module>slc-maven</module>
</modules>
+ <profiles>
+ <profile>
+ <id>rpmbuild</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>install</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <copy todir="${rpm.stagingRepository}" verbose="true">
+ <fileset dir="${project.build.directory}/rpm"
+ includes="*/RPMS/**/*.rpm" />
+ <flattenmapper />
+ </copy>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>dist</artifactId>
+ <version>0.13.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.argeo.slc.dist</groupId>
+ <artifactId>slc-maven</artifactId>
+ <packaging>pom</packaging>
+ <name>SLC Distribution Maven</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.slc.runtime</groupId>
+ <artifactId>org.argeo.slc.support.maven</artifactId>
+ </dependency>
+ </dependencies>
+ <profiles>
+ <profile>
+ <id>rpmbuild</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>rpm-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>rpm-slc-maven</id>
+ <phase>package</phase>
+ <goals>
+ <goal>rpm</goal>
+ </goals>
+ <configuration>
+ <name>slc-maven</name>
+ <copyright>2011 Argeo</copyright>
+ <mappings>
+ <mapping>
+ <directory>/usr/share/osgi</directory>
+ <username>root</username>
+ <groupname>root</groupname>
+ <filemode>644</filemode>
+ <directoryIncluded>false</directoryIncluded>
+ <dependency>
+ <includes>
+ <include>org.argeo.slc.runtime:org.argeo.slc.support.maven</include>
+ </includes>
+ </dependency>
+ </mapping>
+ <mapping>
+ <directory>/var/lib/slc/.m2</directory>
+ <username>slc</username>
+ <groupname>slc</groupname>
+ <filemode>644</filemode>
+ <directoryIncluded>false</directoryIncluded>
+ <sources>
+ <source>
+ <location>src/main/var/lib/slc/.m2</location>
+ </source>
+ </sources>
+ </mapping>
+ </mappings>
+ <preremoveScriptlet>
+ <scriptFile>src/main/scripts/preremove</scriptFile>
+ </preremoveScriptlet>
+ <requires>
+ <require>slc</require>
+ </requires>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file
--- /dev/null
+<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/settings-1.0.0.xsd">
+ <mirrors>
+ <mirror>
+ <id>slc-repo</id>
+ <name>SLC Repository</name>
+ <url>http://localhost:7080/org.argeo.slc.repo.webapp/maven</url>
+ <mirrorOf>*</mirrorOf>
+ </mirror>
+ </mirrors>
+ <servers>
+ <server>
+ <id>slc-repo</id>
+ <username>root</username>
+ <password>demo</password>
+ </server>
+ <server>
+ <id>localrepo</id>
+ <username>root</username>
+ <password>demo</password>
+ </server>
+ <server>
+ <id>localrepo.snapshots</id>
+ <username>root</username>
+ <password>demo</password>
+ </server>
+ </servers>
+</settings>
+
--- /dev/null
+if [ $1 = "0" ];then
+ APP=slc
+ rm -rf /var/lib/$APP/.m2/repository
+fi
if [ $1 = "1" ];then
APP=%{name}
- # create application user (EL5)
- useradd -r --home-dir /var/lib/$APP --shell /sbin/nologin --create-home $APP
+ # check if user exists
+ /bin/id $APP 2>/dev/null
+ if [ $? -ne 0 ];then
+ # create application user (EL5)
+ useradd -r --home-dir /var/lib/$APP --shell /sbin/nologin --create-home $APP
+ fi
# give read access to group on home
chmod g+r /var/lib/$APP
if [ $1 = "1" ];then
APP=%{name}
- # create application user (EL6)
- useradd --system --home-dir /var/lib/$APP --shell /sbin/nologin --user-group --create-home $APP
+ # check if user exists
+ /bin/id $APP 2>/dev/null
+ if [ $? -ne 0 ];then
+ # create application user (EL6)
+ useradd --system --home-dir /var/lib/$APP --shell /sbin/nologin --user-group --create-home $APP
+ fi
# give read access to group on home
chmod g+r /var/lib/$APP
#APP=%{name} => doesn't work
APP=slc
/sbin/chkconfig --del $APP
- userdel $APP
+ #userdel $APP
fi
#APP=%{name} => doesn't work
APP=slc
/sbin/chkconfig --del $APP
- userdel $APP
+ #userdel $APP
fi