Browse Source

Remove all legacy stuff

Serj Kalichev 6 years ago
parent
commit
dfae82df96

+ 6 - 0
.gitignore

@@ -0,0 +1,6 @@
+debian/files
+debian/repoforge.debhelper.log
+debian/repoforge.substvars
+debian/repoforge
+debian/stamp-*
+debian/tmp

+ 8 - 63
Makefile

@@ -1,32 +1,16 @@
-# $Id: Makefile 534 2008-04-08 11:36:22Z gloomy $
 include Rules.make
 
 VERTITLE := $(TITLE)-$(VERSION)
 SUBDIRS  :=
-DATE := $(shell date +'%Y%m%d')
-ARCHIVE := "$(TITLE)-$(DATE).tar.bz2"
-RELEASE := "$(VERTITLE).tar.bz2"
-RPMBUILD := $(shell \
-    rpmbuild --help 2>/dev/null >/dev/null; \
-    if [ $$? == "0" ]; then \
-	echo rpmbuild; \
-    else \
-	echo rpm; \
-    fi \
-    )
-HISTORY := "History"
+DATE     := $(shell date +'%Y%m%d')
+ARCHIVE  := "$(TITLE)-$(DATE).tar.bz2"
+RELEASE  := "$(VERTITLE).tar.bz2"
 
-all: prep
+all:
 	@for dir in $(SUBDIRS); do \
 		$(MAKE) -C $$dir $(@) || exit 1; \
 	done;
 
-prep:
-#	sed -e "s|_unique_source_version_|$(VERSION)|" \
-#	-e "s|_unique_libdir_|$(LIB_DIR)|" \
-#	-e "s|_unique_makefiles_dir_|$(TARGET_MAKEFILES_DIR)|" \
-#	$(SCRIPTS_DIR)/$(TITLE)-config.in > $(SCRIPTS_DIR)/$(TITLE)-config
-
 clean:
 	$(RM) *.spec *.tar.bz2
 	rm -f $(SCRIPTS_DIR)/$(TITLE)-config
@@ -38,35 +22,14 @@ install: all
 	@for dir in $(SUBDIRS); do \
 		$(MAKE) -C $$dir install || exit 1; \
 	done;
-
-# Install Makefiles
-	install -d $(INSTALL_MAKEFILES_DIR)
-	install -m 0644 $(MAKEFILES_DIR)/Makefile.repo	$(INSTALL_MAKEFILES_DIR)
-	install -m 0644 $(MAKEFILES_DIR)/Makefile.project	$(INSTALL_MAKEFILES_DIR)
-
-# Install scripts and other stuff
-	install -d $(INSTALL_BIN_DIR)
-	install -m 0755 $(SCRIPTS_DIR)/rf	$(INSTALL_BIN_DIR)
-
+	# Install scripts and other stuff
 	install -d $(INSTALL_SBIN_DIR)
 	install -m 0755 $(SCRIPTS_DIR)/rfa	$(INSTALL_SBIN_DIR)
-
-# Install configs
+	# Install configs
 	install -d $(INSTALL_CONF_DIR)
 	install -m 0644 $(CONF_DIR)/rfa.conf	$(INSTALL_CONF_DIR)
 
-	install -d $(INSTALL_PC_DIR)
-	install -m 0644 $(CONF_DIR)/repoforge.pc	$(INSTALL_PC_DIR)
-
-spec:
-	sed -e "s|_unique_source_name_|$(ARCHIVE)|" \
-		-e "s|_unique_source_version_|$(VERSION)|" \
-		-e "s|_unique_source_major_|$(MAJOR)|" \
-		-e "s|_unique_source_minor_|$(MINOR)|" \
-		-e "s|_unique_source_bugfix_|$(BUGFIX)|" \
-		$(TITLE).spec.in > $(TITLE).spec
-
-archive: clean spec
+archive: clean
 	ln -sf ./ $(VERTITLE)
 	tar -cj --exclude $(VERTITLE)/$(VERTITLE) --exclude .svn --exclude CVS --exclude $(ARCHIVE) -f $(ARCHIVE) $(VERTITLE)/*
 	$(RM) $(VERTITLE)
@@ -74,22 +37,4 @@ archive: clean spec
 release: archive
 	mv -f $(ARCHIVE) $(RELEASE)
 
-srpm: archive
-	$(RPMBUILD) -ts $(ARCHIVE)
-
-rpm: archive
-	$(RPMBUILD) -tb $(ARCHIVE)
-
-history:
-	@> $(HISTORY)
-	@echo "Project: "$(TITLE) >> $(HISTORY)
-	@echo "Version: "$(VERSION) >> $(HISTORY)
-	@echo "Date: "`date` >> $(HISTORY)
-	-@svn update; \
-	if [ $$? == 0 ]; then \
-		svn info | grep "Revision:" >> $(HISTORY); \
-		echo "History:" >> $(HISTORY); \
-		svn -v log >> $(HISTORY); \
-	fi;
-
-.PHONY: all clean libs utils tests install po archive spec rpm srpm history
+.PHONY: all clean libs utils tests install po archive

+ 2 - 5
Rules.make

@@ -2,17 +2,15 @@
 
 TITLE := repoforge
 MAJOR := 0
-MINOR := 5
-BUGFIX := 1
+MINOR := 6
+BUGFIX := 0
 VERSION := $(MAJOR).$(MINOR).$(BUGFIX)
 
-MAKEFILES_DIR		:= makefiles
 SCRIPTS_DIR		:= scripts
 CONF_DIR		:= conf
 
 TARGET_PREFIX_DIR	:= /usr
 TARGET_DATA_DIR		:= $(TARGET_PREFIX_DIR)/share
-TARGET_MAKEFILES_DIR	:= $(TARGET_DATA_DIR)/$(TITLE)
 TARGET_BIN_DIR		:= $(TARGET_PREFIX_DIR)/bin
 TARGET_SBIN_DIR		:= $(TARGET_PREFIX_DIR)/sbin
 TARGET_PC_DIR		:= $(TARGET_DATA_DIR)/pkgconfig
@@ -22,7 +20,6 @@ DESTDIR			:= /
 INSTALL_FAKE_ROOT	:= $(DESTDIR)
 INSTALL_PREFIX_DIR	:= $(INSTALL_FAKE_ROOT)$(TARGET_PREFIX_DIR)
 INSTALL_DATA_DIR	:= $(INSTALL_FAKE_ROOT)$(TARGET_DATA_DIR)
-INSTALL_MAKEFILES_DIR	:= $(INSTALL_FAKE_ROOT)$(TARGET_MAKEFILES_DIR)
 INSTALL_BIN_DIR		:= $(INSTALL_FAKE_ROOT)$(TARGET_BIN_DIR)
 INSTALL_SBIN_DIR	:= $(INSTALL_FAKE_ROOT)$(TARGET_SBIN_DIR)
 INSTALL_PC_DIR		:= $(INSTALL_FAKE_ROOT)$(TARGET_PC_DIR)

+ 0 - 10
conf/repoforge.pc

@@ -1,10 +0,0 @@
-prefix=/usr
-exec_prefix=/usr
-libdir=/usr/share
-includedir=/usr/include
-makefiledir=${libdir}/repoforge
- 
-Name: repoforge
-Description: Repository building helper
-Version: 1.0
-Cflags: -I${includedir}

+ 7 - 5
conf/rfa.conf

@@ -2,11 +2,13 @@
 group_gid_min=3000
 
 # Prefixes for write and read vcs group names
-group_r_prefix=svn_r-
-group_w_prefix=svn_w-
+group_r_prefix=vcs-r-
+group_w_prefix=vcs-w-
 
-repository_root=/massiv/svn
+# SVN paths
+repository_root=/data/svn
 repository_link=/svn
 
-
-
+# GIT paths
+repository_git_root=/data/git
+repository_git_link=/git

+ 7 - 0
debian/changelog

@@ -1,3 +1,10 @@
+repoforge (0.6.0) unstable; urgency=low
+
+  * Remove legacy rf utility;
+  * Add GIT support.
+
+ -- Serj Kalichev <serj.kalichev@gmail.com>  Tue, 06 May 2014 18:26:46 +0300
+
 repoforge (0.4.0) unstable; urgency=low
 
   * Allow multiply repositories with add/del commands;

+ 3 - 14
debian/control

@@ -7,18 +7,7 @@ Standards-Version: 3.8.0
 
 Package: repoforge
 Architecture: all
-Depends: make
-Description: system to store packages in VCS
- RepoForge helps to store and develop packages using VCS. The packages is
- Debian source packages and SRPMs. These packages is binary files and it's
- not a right way to store binary information in VCS. RepoForge provides
- some additional infrastructure to store only origin sources in binary form
- but all additional changes is in text form suitable for development. The
- Subversion is supported now.
-
-Package: repoforge-admin
-Architecture: all
-Depends: passwd, subversion
+Depends: passwd, subversion, git
 Description: utility to serve VCS repositories
- Utility rfa helps to maintain VCS repositories. The Subversion is
- supported now.
+ Utility rfa helps to maintain VCS repositories. The Subversion and a
+ GIT are supported now.

+ 28 - 20
debian/copyright

@@ -1,7 +1,7 @@
 This package was debianized by Serj Kalichev <serj.kalichev@gmail.com> on
 Wed, 29 Oct 2008 18:04:51 +0300.
 
-It was downloaded from http://repoforge.astra.rusbitech.ru
+It was downloaded from http://birq.libcode.org
 
 Upstream Authors:
 
@@ -13,23 +13,31 @@ Copyright:
 
 License:
 
-    This package is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This package is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this package; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-On Debian systems, the complete text of the GNU General
-Public License can be found in `/usr/share/common-licenses/GPL'.
-
-The Debian packaging is (C) 2008, pkun <serj.kalichev@gmail.com> and
-is licensed under the GPL, see above.
+New BSD licence.
+Copyright (c) 2013 Serj Kalichev <serj.kalichev@gmail.com>.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+3. The name of the author may not be used to endorse or promote products derived
+   from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 

+ 0 - 2
debian/repoforge-admin.install

@@ -1,2 +0,0 @@
-usr/sbin/rfa
-etc/repoforge/rfa.conf

+ 2 - 3
debian/repoforge.install

@@ -1,3 +1,2 @@
-usr/bin/rf
-usr/share/pkgconfig/*
-usr/share/repoforge/*
+usr/sbin/rfa
+etc/repoforge/rfa.conf

+ 0 - 69
makefiles/Makefile.lib

@@ -1,69 +0,0 @@
-# $Id: Makefile 357 2007-06-26 14:28:49Z pkun $
-include ../Rules.make
-
-ifdef VERSION_SCRIPT
-LDFLAGS		+= --version-script=$(VERSION_SCRIPT) 
-endif
-CFLAGS		+= $(CFLAGS_SO)
-WL		:= -Wl,
-WL_RPATH_LINK	:= $(WL)-rpath-link,
-I		:= $(addprefix -I, $(INC_PATH))
-L		:= $(addprefix -L, $(LIB_PATH))
-WL_L		:= $(addprefix $(WL_RPATH_LINK), $(LIB_PATH))
-WL_LDFLAGS	:= $(addprefix $(WL), $(LDFLAGS))
-
-A	:= lib$(NAME).a
-LDSO	:= lib$(NAME).so
-SONAME	:= $(LDSO).$(MAJOR)
-SO	:= $(SONAME).$(MINOR)
-
-OBJ	:= $(patsubst %.c, %.o, $(SRC))
-
-ifndef NO_SO
-ALL	+= $(SO)
-endif
-ifndef NO_A
-ALL	+= $(A)
-endif
-############################################
-
-all: locale_all_pre $(ALL) locale_all locale_all_post
-
-$(SO): $(OBJ) 
-	$(CC) -Wl,-soname,$(SONAME) -shared -o $(@) $(^) $(LOBJS) $(LIBS) $(L) $(WL_L) $(WL_LDFLAGS)
-	ln -sf $(@) $(SONAME)
-	ln -sf $(SONAME) $(LDSO)
-
-$(A): $(OBJ)
-	for l in $(LIBS_STATIC); do\
-		objs=`$(AR) t $$l`;\
-		$(AR) x $$l;\
-		$(AR) $(ARFLAGS) $(@) $$objs;\
-		rm $$objs;\
-	done;\
-	$(AR) $(ARFLAGS) $(@) $(^)
-
-$(OBJ): %.o : %.c
-	$(CC) -c $(<) $(I) $(CFLAGS) $(CPPFLAGS)
-
-include $(wildcard *.d)
-
-clean: locale_clean
-	$(RM) *.o *.d *.a *.so *.so.*
-
-install: all locale_install_pre install_lib locale_install locale_install_post
-
-install_lib:
-ifndef NO_INSTALL
-	install -d $(INSTALL_LIB_DIR)
-ifndef NO_A
-	install $(A) $(INSTALL_LIB_DIR)
-endif
-ifndef NO_SO
-	install -m 0755 $(SO) $(INSTALL_LIB_DIR)
-	ln -sf $(SO) $(INSTALL_LIB_DIR)/$(SONAME)
-	ln -sf $(SONAME) $(INSTALL_LIB_DIR)/$(LDSO)
-endif
-endif
-
-.PHONY: all clean install locale_all_pre locale_all locale_all_post locale_install_pre locale_install locale_install_post locale_clean

+ 0 - 3
makefiles/Makefile.project

@@ -1,3 +0,0 @@
-# $Id$
-REPOFORGE_MAKEFILES := $(shell pkg-config --variable=makefiledir repoforge)
-include $(REPOFORGE_MAKEFILES)/Makefile.repo

+ 0 - 230
makefiles/Makefile.repo

@@ -1,230 +0,0 @@
-# $Id$
-REPOFORGE := repoforge
-include package.$(REPOFORGE)
-
-PWD := $(shell pwd)
-WORK_DIR := work
-TEMP_DIR := temp
-BUILD_DIR := build
-
-# Function to find out absolute path
-absname = $(if $(filter /%,$(1)),$(1),$(PWD)/$(1))
-
-# Structure of repoforge tree
-ifndef sources_dir
-SOURCES_DIR_ORIG := sources
-else
-SOURCES_DIR_ORIG := $(sources_dir)
-endif
-SOURCES_DIR := $(call absname,$(SOURCES_DIR_ORIG))
-ifndef specs_dir
-SPECS_DIR_ORIG := $(SOURCES_DIR_ORIG)
-else
-SPECS_DIR_ORIG := $(specs_dir)
-endif
-SPECS_DIR := $(call absname,$(SPECS_DIR_ORIG))
-
-PATCH_NAME := $(title)-$(version)-$(REPOFORGE).patch
-PATCH := $(SOURCES_DIR)/$(PATCH_NAME)
-PATCH_LINK := $(PATCH_NAME)
-DATE := $(shell date +'%Y%m%d')
-HISTORY := "History"
-EXCLUDE := exclude.$(REPOFORGE)
-AUTO_EXCLUDE := auto_exclude.$(REPOFORGE)
-
-#------------------- Check title and version
-ifndef title
-  ${error Package title is not specified.}
-endif
-
-#------------------- Find out base package system
-PKG_LEGAL := 0
-ifndef pkg
-  ${error Package system is not specified.}
-endif
-
-ifeq "$(pkg)" "rpm"
-  PKG_LEGAL := 1
-  RPM := rpm
-  RPMBUILD := $(shell \
-    rpmbuild --help 2>/dev/null >/dev/null; \
-    if [ $$? == "0" ]; then \
-	echo rpmbuild; \
-    else \
-	echo rpm; \
-    fi \
-    )
-  RPMOPTS := --define="_sourcedir $(SOURCES_DIR)" --define="_builddir $(PWD)/$(BUILD_DIR)" --define="_specdir $(SPECS_DIR)"
-  PKG_SPEC_NAME := $(title).spec
-  PKG_SPEC := $(SPECS_DIR)/$(PKG_SPEC_NAME)
-  PKG_SPEC_LINK := $(title).spec
-  PKG_WITH_PATCH := --with $(REPOFORGE)_patch
-  PKG_WITHOUT_PATCH := --without $(REPOFORGE)_patch
-  PKG_BP_BUILD := $(RPMBUILD) $(RPMOPTS) -bp --nodeps
-  PKG_BC_BUILD := $(RPMBUILD) $(RPMOPTS) -bc
-  PKG_BS := $(RPMBUILD) $(RPMOPTS) -bs
-  PKG_BB := $(RPMBUILD) $(RPMOPTS) -bb
-  PKG_TREE := $(RPM) $(RPMOPTS) -ivh --nodeps
-endif
-ifeq "$(pkg)" "deb"
-  ${warning Debian package system is not supported yet.}
-endif
-
-ifeq ($(PKG_LEGAL),0)
-  ${error Unsupported package system $(pkg).}
-endif
-
-# Public targets
-
-all: buildprep
-
-clean: temp_del build_del clean_rm
-
-init: work_dir work_link build_bp
-
-bp: temp_dir temp_link build_bp cp_build_work work_link temp_del
-
-bc: temp_dir temp_link build_bc cp_build_work work_link temp_del
-
-srpm: bs
-bs: temp_dir temp_link orig patch_diff build_bs work_link temp_del
-
-rpm: bb
-bb: temp_dir temp_link orig patch_diff build_bb work_link temp_del
-
-patch: temp_dir temp_link orig patch_diff work_link temp_del
-
-prep: rpmize work_link
-
-repair: rep
-rep: clean prep
-
-copy: cop
-cop: cp_build_work work_link temp_del 
-
-# Internal targets
-
-clean_rm:
-	@$(RM) $(PATCH) $(PATCH_LINK) $(AUTO_EXCLUDE) $(HISTORY)
-	@if [ -h $(PKG_SPEC_LINK) ]; then \
-		$(RM) $(PKG_SPEC_LINK); \
-	fi
-
-init_svn:
-	@echo "Add working dir $(WORK_DIR) to the repository..."
-	@status=`svn -N st $(WORK_DIR)`; \
-	if [[ "$$status" =~ "^\?" ]]; then \
-		svn add $(WORK_DIR); \
-		svn ci -m "Initial working dir. Created by repoforge init command." $(WORK_DIR); \
-#		echo "OK"; \
-	else \
-		echo "Directory $(WORK_DIR) is already in repository."; \
-	fi;
-
-build_bp:
-	@echo "Build source tree...";
-	$(PKG_BP_BUILD) $(PKG_SPEC)
-
-orig:
-	$(PKG_BP_BUILD) $(PKG_WITHOUT_PATCH) $(PKG_SPEC)
-
-build_bc:
-	@echo "Build package...";
-	$(PKG_BC_BUILD) $(PKG_SPEC)
-
-cp_build_work:
-	@echo "Copy data from temporary to working directory..."; \
-	tar -c -C $(BUILD_DIR) `ls -A $(BUILD_DIR)` | tar -x -C $(WORK_DIR)
-
-temp_dir:
-	@if [ ! -d $(TEMP_DIR) ]; then \
-		mkdir $(TEMP_DIR); \
-	else \
-		rm -Rf $(TEMP_DIR)/*; \
-	fi; \
-
-temp_del:
-	@rm -Rf $(TEMP_DIR)
-
-work_dir:
-	@echo "Creating directory $(WORK_DIR) ..."
-	@if [ ! -d $(WORK_DIR) ]; then \
-		mkdir $(WORK_DIR); \
-	else \
-		rm -Rf $(WORK_DIR)/*; \
-	fi
-
-work:
-	@echo "Preparing directory $(WORK_DIR) ..."
-	$(PKG_BP_WORK) $(PKG_WITHOUT_PATCH) $(PKG_SPEC)
-
-work_del:
-	@rm -Rf $(WORK_DIR)
-
-buildprep: patch
-
-patch_diff:
-	@echo "Making patch..."
-	@> $(AUTO_EXCLUDE)
-	@svn st $(WORK_DIR) | grep -E "^\?" | sed -e "s|^\? *[^/]*/||" >> $(AUTO_EXCLUDE)
-	@LC_ALL=en_US diff --exclude=".svn" -uNrp $(BUILD_DIR) $(WORK_DIR) | filterdiff -p 1 -X $(AUTO_EXCLUDE) -X $(EXCLUDE) | filterdiff > $(PATCH); true
-	@if [ ! -f $(PATCH_LINK) ]; then \
-		ln -s -f -n $(SOURCES_DIR_ORIG)/$(PATCH_NAME) $(PATCH_LINK); \
-	fi
-
-work_link:
-	@ln -f -n -s $(WORK_DIR) $(BUILD_DIR)
-
-temp_link:
-	@ln -f -n -s $(TEMP_DIR) $(BUILD_DIR)
-
-build_del:
-	@if [ -h "$(BUILD_DIR)" ]; then \
-		$(RM) $(BUILD_DIR); \
-	fi
-
-
-rpmize: spec_link
-
-spec_link:
-ifeq "$(pkg)" "rpm"
-	@if [ ! -f $(PKG_SPEC_LINK) ]; then \
-		ln -s -n -f $(SPECS_DIR_ORIG)/$(PKG_SPEC_NAME) $(PKG_SPEC_LINK); \
-	fi
-endif
-
-tree:
-	@if [ ! -f "$(SOURCES_DIR)" ]; then \
-		mkdir -p $(SOURCES_DIR); \
-	fi
-ifeq "$(pkg)" "rpm"
-	@if [ ! -f "$(SPECS_DIR)" ]; then \
-		mkdir -p $(SPECS_DIR); \
-	fi
-endif
-	@if [ -f "$(SOURCE)" ]; then \
-		$(PKG_TREE) $(SOURCE); \
-	fi
-
-build_bs:
-	@echo "Building SRPM..."
-	$(PKG_BS) $(PKG_SPEC)
-
-build_bb:
-	@echo "Building RPM..."
-	$(PKG_BB) $(PKG_SPEC)
-
-history:
-	@> $(HISTORY)
-	@echo "Project: "$(TITLE) >> $(HISTORY)
-	@echo "Version: "$(version) >> $(HISTORY)
-	@echo "Date: "`date` >> $(HISTORY)
-	-@svn update; \
-	if [ $$? == 0 ]; then \
-		svn info | grep "Revision:" >> $(HISTORY); \
-		echo "History:" >> $(HISTORY); \
-		svn -v log >> $(HISTORY); \
-	fi;
-
-.PHONY: all clean clean_rm install archive rpm srpm history patch build_del buildprep prep work temp work_del temp_del bp bb bs bc init temp_bp temp_cp temp_bc tree work_link temp_link build_bp orig build_bb build_bs
-

+ 0 - 84
repoforge.spec.in

@@ -1,84 +0,0 @@
-# $Id$
-
-%if %{_arch} != %{_build_arch}
-%define cross_compile 1
-%else
-%define cross_compile 0
-%endif
-%ifarch %{ix86}
-%define cross_compile 0
-%endif
-
-#undefine _enable_debug_packages
-
-# Version
-%define major _unique_source_major_
-%define minor _unique_source_minor_
-
-Name: repoforge
-Summary: Helper tools for distributive creation.
-Version: %{major}.%{minor}
-Release: vniins3
-License: %{_license}
-Vendor: %{_vendor}
-Group: %{_group_tools}
-BuildRoot: /var/tmp/%{name}-root
-Requires: make
-Source0: _unique_source_name_
-
-%description
-Helper tools for building distributive. 
-It allows to use subversion (or another control version systems) to store SRPM packages and
-makes easier the development and patching.
-
-%prep
-
-%setup -q
-
-%build
-
-%if %{cross_compile}==1
-export LDFLAGS=" $LDFLAGS -L$TARGET_ROOTFS/lib "
-%endif
-
-make VERSION=%{version}
-
-%install
-rm -rf ${RPM_BUILD_ROOT} 
-make install \
-	INSTALL_FAKE_ROOT=${RPM_BUILD_ROOT} \
-	TARGET_DATA_DIR=%{_datadir} \
-	TARGET_BIN_DIR=%{_bindir} \
-	VERSION=%{version}
-%post 
-#/sbin/ldconfig
-
-%preun
-
-%postun
-#/sbin/ldconfig
-
-%clean
-rm -rf ${RPM_BUILD_ROOT} 
-
-%files
-%defattr(-,root,root)
-%dir %{_datadir}/%{name}
-%{_datadir}/%{name}/*
-%dir %{_bindir}
-%attr(0755,root,root) %{_bindir}/rf
-%dir %{_datadir}/pkgconfig
-%attr(0644,root,root) %config(noreplace) %{_datadir}/pkgconfig/* 
-#%config(noreplace) %{_mcfgdir}/mswitch.conf
-
-%changelog
-
-* Tue Jul 01 2008 Serj Kalichev (serj.kalichev@gmail.com) vniins3
-- New directory structure;
-- Targets pepair, copy etc.
-
-* Tue Jun 05 2008 Serj Kalichev (serj.kalichev@gmail.com) vniins2
-- New concept using rf utility.
-
-* Mon May 19 2008 Serj Kalichev (serj.kalichev@gmail.com) vniins1
-- First version.

+ 0 - 38
scripts/rf

@@ -1,38 +0,0 @@
-#!/bin/sh
-
-REPOFORGE=repoforge
-PACKAGE_FILE=package.$REPOFORGE
-if [ $# -lt 1 ]; then
-	set "all"
-fi
-MAKEFILEDIR=`pkg-config --variable=makefiledir repoforge`
-if [ -f "Makefile" ]; then
-	MAKEFILE=./Makefile
-else
-	MAKEFILE=$MAKEFILEDIR/Makefile.repo
-fi
-TARGETS=`make --makefile="$MAKEFILE" --print-data-base --dry-run --ignore-errors --keep-going 2>/dev/null | grep -E "^$1:"`
-IFSRC=`echo "$1" | grep -E "src.rpm$"`
-if [ "$TARGETS" ]; then
-	make --makefile="$MAKEFILE" "$@"
-#	echo "make --makefile=$MAKEFILE $@"
-elif [ "$IFSRC" ]; then
-	SOURCE=$1
-	shift
-	TITLE=`echo $SOURCE | sed -r "s|-[^-]*-[^-]*\.src\.rpm$||"`
-	echo "Title: $TITLE"
-	VERSION=`echo $SOURCE | sed -r "s|.*-([^-]*)-[^-]*\.src\.rpm$|\1|"`
-	echo "Version: $VERSION"
-	RELEASE=`echo $SOURCE | sed -r "s|.*-[^-]*-([^-]*)\.src\.rpm$|\1|"`
-	echo "Release: $RELEASE"
-	> $PACKAGE_FILE
-	echo "# Auto generated file by repoforge" >> $PACKAGE_FILE
-	echo >> $PACKAGE_FILE
-	echo "title = $TITLE" >> $PACKAGE_FILE
-	echo "version = $VERSION" >> $PACKAGE_FILE
-	echo "pkg = rpm" >> $PACKAGE_FILE
-	make --makefile="$MAKEFILE" tree init prep SOURCE="$SOURCE" "$@"
-else
-	svn "$@"
-#	echo "svn $@"
-fi

+ 27 - 35
scripts/rfa

@@ -26,28 +26,28 @@ EOF
 
 group_add()
 {
-	groupadd -K GID_MIN=${group_gid_min} "${group_r_prefix}$1"
-	groupadd -K GID_MIN=${group_gid_min} "${group_w_prefix}$1"
+	groupadd -K GID_MIN=${group_gid_min} "${group_r_prefix}$1" || return 1
+	groupadd -K GID_MIN=${group_gid_min} "${group_w_prefix}$1" || return 1
 }
 
 group_del()
 {
-	groupdel "${group_r_prefix}$1"
-	groupdel "${group_w_prefix}$1"
+	groupdel "${group_r_prefix}$1" || return 1
+	groupdel "${group_w_prefix}$1" || return 1
 }
 
 create_repo_svn()
 {
-	svnadmin --fs-type=fsfs create "$1"
+	svnadmin --fs-type=fsfs create "$1" || return 1
 }
 
 create_repo_git()
 {
 	local saved_dir=""
 	saved_dir=`pwd`
-	mkdir "$1"
+	mkdir "$1" || return 1
 	cd "$1"
-	git init --bare >/dev/null
+	git init --bare --shared >/dev/null || return 1
 	cd "$saved_dir"
 }
 
@@ -63,7 +63,7 @@ data_add()
 	local saved_umask=`umask`
 	umask 002
 	local create_vcs_func="create_repo_$opts_vcs"
-	$create_vcs_func "$repo_w"
+	$create_vcs_func "$repo_w" || return 1
 	umask ${saved_umask}
 }
 
@@ -75,16 +75,16 @@ data_fixmod()
 	local repo_r="${r_root}/${r_name}"
 	local repo_w="${r_root}/${r_name}/${r_name}"
 
-	chmod 750 "${repo_r}"
-	chgrp "${group_r_prefix}${r_name}" "${repo_r}"
-	chgrp -R "${group_w_prefix}${r_name}" "${repo_w}"
+	chmod 750 "${repo_r}" || return 1
+	chgrp "${group_r_prefix}${r_name}" "${repo_r}" || return 1
+	chgrp -R "${group_w_prefix}${r_name}" "${repo_w}" || return 1
 	local dirs=""
 	dirs=`find "$repo_w" -type d`
 	local dir=""
 	for dir in $dirs; do
-		chmod g+s "$dir"
+		chmod g+s "$dir" || return 1
 	done
-	chmod -R g+w "${repo_w}"
+	chmod -R g+w "${repo_w}" || return 1
 }
 
 data_del()
@@ -122,10 +122,10 @@ repository_add()
 		test "x$repo_link" = "x" && { echo "Error: Illegal repository link \"\"" 1>&2; exit 1; }
 		test -d "$repo_root" || { echo "Error: Illegal repository root \"$repo_root\"" 1>&2; exit 1; }
 		test -d "$repo_link" || { echo "Error: Illegal repository link \"$repo_link\"" 1>&2; exit 1; }
-		group_add "$rep_name"
-		data_add "$rep_name" "$repo_root" "$repo_link"
-		data_fixmod "$rep_name" "$repo_root" "$repo_link"
-		link_add "$rep_name" "$repo_root" "$repo_link"
+		group_add "$rep_name" || { echo "Error: Can't add group for repository \"$rep_name\"" 1>&2; exit 1; }
+		data_add "$rep_name" "$repo_root" "$repo_link" || { echo "Error: Can't add repository \"$rep_name\"" 1>&2; exit 1; }
+		data_fixmod "$rep_name" "$repo_root" "$repo_link" || { echo "Error: Can't fix mode for repository \"$rep_name\"" 1>&2; exit 1; }
+		link_add "$rep_name" "$repo_root" "$repo_link" || { echo "Error: Can't add link for repository \"$rep_name\"" 1>&2; exit 1; }
 		echo "The repository \"$rep_name\" was succesfully created."
 	done
 }
@@ -142,9 +142,9 @@ repository_del()
 			read -r -p "Deleting repository \"$rep_name\". Are you sure (y/n)? " sure
 			test "x$sure" = "xy" -o "x$sure" = "xY" || { echo "The repository \"$rep_name\" will be not deleted."; continue; }
 		fi
-		link_del "$rep_name" "$repo_link"
-		data_del "$rep_name" "$repo_root"
-		group_del "$rep_name"
+		link_del "$rep_name" "$repo_link" || { echo "Error: Can't remove link for repository \"$rep_name\"" 1>&2; exit 1; }
+		data_del "$rep_name" "$repo_root" || { echo "Error: Can't remove repository \"$rep_name\"" 1>&2; exit 1; }
+		group_del "$rep_name" || { echo "Error: Can't remove group for repository \"$rep_name\"" 1>&2; exit 1; }
 		echo "The repository \"$rep_name\" was succesfully deleted."
 	done
 }
@@ -156,8 +156,8 @@ repository_fixmod()
 	for rep_name in "$@"; do
 		find_repo "$rep_name"
 		test "x$repo_root" = "x" -o "x$repo_link" = "x" && { echo "Error: Can't find repository \"$rep_name\"" 1>&2; exit 1; }
-		data_fixmod "$rep_name" "$repo_root" "$repo_link"
-		link_add "$rep_name" "$repo_root" "$repo_link"
+		data_fixmod "$rep_name" "$repo_root" "$repo_link" || { echo "Error: Can't fix repository's \"$rep_name\" mode" 1>&2; exit 1; }
+		link_add "$rep_name" "$repo_root" "$repo_link" || { echo "Error: Can't create link for repository \"$rep_name\"" 1>&2; exit 1; }
 		echo "The repository \"$rep_name\" was succesfully fixed."
 	done
 }
@@ -188,12 +188,8 @@ user_add()
 	esac
 	shift
 	for user_name in "$@"; do
-		if [ $r -ne 0 ]; then
-			adduser "${user_name}" "${group_r_prefix}${repository_name}"
-		fi
-		if [ $w -ne 0 ]; then
-			adduser "${user_name}" "${group_w_prefix}${repository_name}"
-		fi
+		test $r -ne 0 && adduser "${user_name}" "${group_r_prefix}${repository_name}"
+		test $w -ne 0 && adduser "${user_name}" "${group_w_prefix}${repository_name}"
 	done
 }
 
@@ -223,12 +219,8 @@ user_del()
 	esac
 	shift
 	for user_name in "$@"; do
-		if [ $r -ne 0 ]; then
-			deluser "${user_name}" "${group_r_prefix}${repository_name}"
-		fi
-		if [ $w -ne 0 ]; then
-			deluser "${user_name}" "${group_w_prefix}${repository_name}"
-		fi
+		test $r -ne 0 && deluser "${user_name}" "${group_r_prefix}${repository_name}"
+		test $w -ne 0 && deluser "${user_name}" "${group_w_prefix}${repository_name}"
 	done
 }
 
@@ -348,4 +340,4 @@ case "$action" in
 	;;
 esac
 
-exit 0
+exit $?

+ 0 - 12
scripts/rfa.conf

@@ -1,12 +0,0 @@
-# Minimal GID for vcs groups
-group_gid_min=3000
-
-# Prefixes for write and read vcs group names
-group_r_prefix=vcs-r-
-group_w_prefix=vcs-w-
-
-repository_root=/tmp/svn-data
-repository_link=/tmp/svn
-
-repository_git_root=/tmp/git-data
-repository_git_link=/tmp/git