X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.simple%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Flib%2Flinux%2Frpmfactory%2FImportSrpm.java;fp=runtime%2Forg.argeo.slc.support.simple%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Flib%2Flinux%2Frpmfactory%2FImportSrpm.java;h=0000000000000000000000000000000000000000;hb=b9505fef5ba8186433e903e9de3c73c17bdf6562;hp=cd170e30d62db13cb5555bccc7ac2c96b81e8bf1;hpb=04ef2e4533e909122a560a5cb6499fa62bac82ec;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/lib/linux/rpmfactory/ImportSrpm.java b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/lib/linux/rpmfactory/ImportSrpm.java deleted file mode 100644 index cd170e30d..000000000 --- a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/lib/linux/rpmfactory/ImportSrpm.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2007-2012 Argeo GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.slc.lib.linux.rpmfactory; - -import java.io.File; - -import org.argeo.slc.core.execution.tasks.SystemCall; - -/** Install an SRPM into a working copy */ -public class ImportSrpm implements Runnable { - private File baseDir; - private File srpmFile; - private RpmBuildEnvironment rpmBuildEnvironment; - - public void run() { - SystemCall rpmQuery = new SystemCall( - "rpm --queryformat '%{NAME}\n' -qp " + srpmFile); - String packageName = rpmQuery.function(); - - File topdir = new File(baseDir, packageName); - - // prepare SVN - // TODO: do it with SVNKit - topdir.mkdirs(); - new SystemCall("svn add " + topdir).run(); - new SystemCall("svn propset svn:ignore rpm*\nBUILD\nSRPMS\nRPMS " + topdir).run(); - File sourcesDir = new File(topdir, "SOURCES"); - sourcesDir.mkdirs(); - new SystemCall("svn add " + sourcesDir).run(); - new SystemCall("svn propset svn:ignore *gz\n*bz2\n*.zip\n*.jar " + sourcesDir).run(); - File specsDir = new File(topdir, "SPECS"); - specsDir.mkdirs(); - new SystemCall("svn add " + specsDir).run(); - - // Write rpm config files - File rpmmacroFile = new File(topdir, "rpmmacros"); - File rpmrcFile = new File(topdir, "rpmrc"); - rpmBuildEnvironment.writeRpmbuildConfigFiles(topdir, rpmmacroFile, - rpmrcFile); - - // Install SRPM - SystemCall installSrpm = new SystemCall(); - installSrpm.arg("rpm"); - installSrpm.arg("-Uvh"); - installSrpm.arg("--rcfile=" + rpmrcFile.getAbsolutePath()); - installSrpm.arg(srpmFile.getAbsolutePath()); - installSrpm.setExecDir(topdir.getAbsolutePath()); - installSrpm.setLogCommand(true); - installSrpm.run(); - } - - public void setBaseDir(File basedir) { - this.baseDir = basedir; - } - - public void setSrpmFile(File srpmFile) { - this.srpmFile = srpmFile; - } - - public void setRpmBuildEnvironment(RpmBuildEnvironment rpmBuildEnvironment) { - this.rpmBuildEnvironment = rpmBuildEnvironment; - } - -}