-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use list of base directories for which intermediate directories shoul…
…d be generated
- Loading branch information
Showing
5 changed files
with
212 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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> | ||
|
||
<groupId>de.dentrassi.maven.rpm.test</groupId> | ||
<artifactId>test19</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>Test Package #19</name> | ||
<description> | ||
Test explicitly adding and applying rules for implicitly created intermediate directories. | ||
</description> | ||
|
||
<url>http://dentrassi.de</url> | ||
|
||
<organization> | ||
<name>Jens Reimann</name> | ||
<url>http://dentrassi.de</url> | ||
</organization> | ||
|
||
<licenses> | ||
<license> | ||
<name>Eclipse Public License - v 1.0</name> | ||
<distribution>repo</distribution> | ||
<url>https://www.eclipse.org/legal/epl-v10.html</url> | ||
</license> | ||
</licenses> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<skipSigning>true</skipSigning> | ||
<!-- use a predictable timestamp --> | ||
<project.build.outputTimestamp>2009-01-01T12:00:00+01:00</project.build.outputTimestamp> | ||
</properties> | ||
|
||
<build> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>de.dentrassi.maven</groupId> | ||
<artifactId>rpm</artifactId> | ||
<version>@project.version@</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>rpm</goal> | ||
</goals> | ||
<configuration> | ||
<attach>false</attach> | ||
<group>Application/Misc</group> | ||
|
||
<signature> | ||
<keyId>${keyId}</keyId> | ||
<keyringFile>${user.home}/.gnupg/secring.gpg</keyringFile> | ||
<passphrase>${passphrase}</passphrase> | ||
<hashAlgorithm>SHA1</hashAlgorithm> | ||
<skip>${skipSigning}</skip> | ||
</signature> | ||
|
||
<generateIntermediateDirectories> | ||
<baseDirectory>/etc/mycompany/myapp</baseDirectory> | ||
<baseDirecotry>/opt/mycompany/myapp</baseDirecotry> | ||
</generateIntermediateDirectories> | ||
|
||
<rulesets> | ||
<ruleset> | ||
<id>my-default</id> | ||
<rules> | ||
<rule> | ||
<when> | ||
<prefix>/opt/mycompany</prefix> | ||
</when> | ||
<user>mygeneraluser</user> | ||
<group>mygeneralgroup</group> | ||
<mode>0111</mode> | ||
</rule> | ||
<rule> | ||
<when> | ||
<prefix>/opt/mycompany/myapp</prefix> | ||
</when> | ||
<user>myuser</user> | ||
<group>mygroup</group> | ||
<mode>0555</mode> | ||
</rule> | ||
<rule> | ||
<when> | ||
<prefix>/opt/mycompany/myapp</prefix> | ||
<type>directory</type> | ||
</when> | ||
<mode>0777</mode> | ||
</rule> | ||
</rules> | ||
</ruleset> | ||
</rulesets> | ||
|
||
<entries> | ||
<entry> | ||
<name>/opt/mycompany/myapp/a/b/c/foobar</name> | ||
<file>${project.basedir}/src/main/data/foobar</file> | ||
<ruleset>my-default</ruleset> | ||
</entry> | ||
<entry> | ||
<name>/opt/mycompany/myapp</name> | ||
<directory>true</directory> | ||
<ruleset>my-default</ruleset> | ||
</entry> | ||
<entry> | ||
<name>/etc/mycompany/myapp/defaults</name> | ||
<directory>true</directory> | ||
<ruleset>my-default</ruleset> | ||
</entry> | ||
<entry> | ||
<name>/opt/mycompany/otherapp/a/b/c/foobar</name> | ||
<file>${project.basedir}/src/main/data/foobar</file> | ||
<ruleset>my-default</ruleset> | ||
</entry> | ||
</entries> | ||
|
||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>sign</id> | ||
<activation> | ||
<activeByDefault>false</activeByDefault> | ||
</activation> | ||
<properties> | ||
<skipSigning>false</skipSigning> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
def dump() { | ||
Process proc = ('rpm -q --dump -p ' + basedir + "/target/*.rpm").execute() | ||
return proc.in.getText().trim() | ||
} | ||
|
||
def actual = dump() | ||
println "Dump:\n" + actual | ||
|
||
def expected = """\ | ||
/etc/mycompany/myapp 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X | ||
/etc/mycompany/myapp/defaults 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040755 root root 0 0 0 X | ||
/opt/mycompany/myapp 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040777 myuser mygroup 0 0 0 X | ||
/opt/mycompany/myapp/a 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040777 myuser mygroup 0 0 0 X | ||
/opt/mycompany/myapp/a/b 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040777 myuser mygroup 0 0 0 X | ||
/opt/mycompany/myapp/a/b/c 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040777 myuser mygroup 0 0 0 X | ||
/opt/mycompany/myapp/a/b/c/foobar 0 1230807600 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0100555 myuser mygroup 0 0 0 X | ||
/opt/mycompany/otherapp/a/b/c/foobar 0 1230807600 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0100111 mygeneraluser mygeneralgroup 0 0 0 X""".stripIndent() | ||
|
||
if (actual != expected) { | ||
System.out.format("RPM dump doesn't match - actual:%n%s%nexpected:%n%s%n", actual, expected); | ||
return false; | ||
} | ||
|
||
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters