--- /dev/null
+VERSION:=$(shell date +%Y%m%d)
+RPMTOP:=$(shell rpm --eval '%_topdir')
+ARCH:=$(shell rpm --eval '%_arch')
+DIST:=$(shell rpm --eval '%dist')
+BRANCH=master
+
+rpm: openssl-gost-engine-$(VERSION)-1$(DIST).$(ARCH).rpm
+
+openssl-gost-engine-$(VERSION)-1$(DIST).$(ARCH).rpm: $(RPMTOP)/RPMS/$(ARCH)/openssl-gost-engine-$(VERSION)-1$(DIST).$(ARCH).rpm
+ cp $^ $@
+
+$(RPMTOP)/RPMS/$(ARCH)/openssl-gost-engine-$(VERSION)-1.$(ARCH).rpm: $(RPMTOP)/SOURCES/openssl-gost-engine-$(VERSION).tar.bz2 $(RPMTOP)/SPECS/openssl-gost-engine.spec
+ mkdir -p $(RPMTOP)/RPMS/$(ARCH) || true
+ mkdir -p $(RPMTOP)/SRPMS
+ rpmbuild -ba $(RPMTOP)/SPECS/openssl-gost-engine.spec
+
+$(RPMTOP)/SPECS/openssl-gost-engine.spec: openssl-gost-engine.spec
+ mkdir -p $(RPMTOP)/SPECS || true
+ sed 's/^Version: .*$$/Version: $(VERSION)/' $^> $@
+
+$(RPMTOP)/SOURCES/openssl-gost-engine-$(VERSION).tar.bz2: engine/README.md
+ mkdir -p $(RPMTOP)/SOURCES || true
+ cd engine; git pull
+ cd engine; git archive --format tar --prefix=openssl-gost-engine-$(VERSION)/ $(BRANCH) > $@
+
+engine/README.md:
+ git clone https://github.com/gost-engine/engine.git
+
+
+envtest:
+ : ARCH=$(ARCH)
+ : VERSION=$(VERSION)
+ : RPMTOP=$(RPMTOP)
--- /dev/null
+Name: openssl-gost-engine
+Version:
+Release: 1%{?dist}
+Summary: Loadable module for openssl implementing GOST cryptoalgoritms
+
+Group: Libraries/Cryptography
+License: OpenSSL
+URL: https://github.com/gost-engine/engine
+Source0: %{name}-%{version}.tar.bz2
+
+BuildRequires: cmake, openssl-devel
+Requires: openssl-libs
+
+%description
+
+This package contains openssl module with software implementation of GOST cryptoalgorithms.
+
+%prep
+%setup -q
+
+
+%build
+cmake .
+make %{?_smp_mflags}
+
+
+%install
+install -d -m 755 %{buildroot}%{_libdir}/engines-1.1
+install -c -m 755 bin/gost.so %{buildroot}%{_libdir}/engines-1.1
+
+%files
+%doc README.gost
+%doc README.md
+%dir %{_libdir}/engines-1.1
+%{_libdir}/engines-1.1/gost.so
+
+%changelog
+
+* Wed Aug 2 2017 Victor Wagner <vitus@wagner.pp.ru>
+- initial release
+