<commit_before>include build.mk

all: prepare
	@export builddir=$(shell pwd)/build; \
	echo $(RPM_VERSION); \
	for pkg in $(PKG); do \
		pkg=$$(basename $${pkg} .spec); \
		echo "Building $${pkg}"; \
		path=$$(rpm -q --specfile --qf "build/RPMS/%{arch}/$${pkg}-${RPM_VERSION}-%{release}.%{arch}.rpm " $${pkg}.spec); \
		echo $${path};\
		rpmbuild --define="_module_name ${PROJ}" --define="_version ${RPM_VERSION}" --define="_topdir $${builddir}" --define="_major ${MAJOR}" --define="_minor {$MINOR}" -bb $${pkg}.spec ; \
			echo 'pwd:'; pwd ; \
			echo $${path};\
			mkdir -p backup-rpms ; \
			cp build/RPMS/*/*.rpm . ;\
			cp build/RPMS/*/*.rpm ./backup-rpms ;\
			continue; \
		echo "Build failed for $${path}, abort."; \
		break; \
	done

# Make rpm building base and source tarball
prepare: clean-build clean-rpm
	echo "Creating source package to build/SOURCES/$(SRC)"
	rm -rf $(TEMP_DIR)/apps
	rm -rf $(TEMP_DIR)/evpp
	rm -rf $(TEMP_DIR)/rpm
	rm -rf $(TEMP_DIR)/$(DEPEND_PROJ)
	mkdir -p $(TEMP_DIR)/apps
	mkdir -p $(TEMP_DIR)/$(DEPEND_PROJ)
	ln -s $(ROOT_DIR) $(TEMP_DIR)/apps/$(PROJ)
	ln -s $(ROOT_DIR)/../../evpp  $(TEMP_DIR)/evpp
	ln -s $(ROOT_DIR)/../../rpm  $(TEMP_DIR)/rpm
	ln -s $(HASHKIT_DIR) $(TEMP_DIR)/$(DEPEND_PROJ)/libhashkit
	ln -s $(MEMCACHE_DIR) $(TEMP_DIR)/$(DEPEND_PROJ)/memcached
	ln -s $(JSON_DIR) $(TEMP_DIR)/$(DEPEND_PROJ)/rapidjson
	$(MAKE) clean -C $(ROOT_DIR)
	tar zchf $(TEMP_DIR)/$(SRC) --exclude "*.tar.gz" --exclude "*.d" --exclude "*.o" --exclude install --exclude bin --exclude "*.so" --exclude "*.a" --exclude "*.rpm" -C $(TEMP_DIR)  evpp apps rapidjson $(DEPEND_PROJ) rpm
	mkdir -p build/{BUILD,RPMS,SRPMS,SPECS,SOURCES}
	mv $(TEMP_DIR)/$(SRC) build/SOURCES/

clean-build:
	rm -rf build

clean-rpm:
	rm -rf *rpm

t :
	@echo $(ROOT_DIR)
	@echo $(COMMITVERSION)

clean: clean-build clean-rpm

.PHONY: pkg prepare clean clean-build clean-rpm t<commit_msg>fix for evnsq pkg<commit_after>include build.mk

all: prepare
	@export builddir=$(shell pwd)/build; \
	echo $(RPM_VERSION); \
	for pkg in $(PKG); do \
		pkg=$$(basename $${pkg} .spec); \
		echo "Building $${pkg}"; \
		path=$$(rpm -q --specfile --qf "build/RPMS/%{arch}/$${pkg}-${RPM_VERSION}-%{release}.%{arch}.rpm " $${pkg}.spec); \
		echo $${path};\
		rpmbuild --define="_module_name ${PROJ}" --define="_version ${RPM_VERSION}" --define="_topdir $${builddir}" --define="_major ${MAJOR}" --define="_minor {$MINOR}" -bb $${pkg}.spec ; \
			echo 'pwd:'; pwd ; \
			echo $${path};\
			mkdir -p backup-rpms ; \
			cp build/RPMS/*/*.rpm . ;\
			cp build/RPMS/*/*.rpm ./backup-rpms ;\
			continue; \
		echo "Build failed for $${path}, abort."; \
		break; \
	done

# Make rpm building base and source tarball
prepare: clean-build clean-rpm
	echo "Creating source package to build/SOURCES/$(SRC)"
	rm -rf $(TEMP_DIR)/apps
	rm -rf $(TEMP_DIR)/evpp
	rm -rf $(TEMP_DIR)/rpm
	rm -rf $(TEMP_DIR)/$(DEPEND_PROJ)
	mkdir -p $(TEMP_DIR)/apps
	mkdir -p $(TEMP_DIR)/$(DEPEND_PROJ)
	ln -s $(ROOT_DIR) $(TEMP_DIR)/apps/$(PROJ)
	ln -s $(ROOT_DIR)/../../evpp  $(TEMP_DIR)/evpp
	ln -s $(ROOT_DIR)/../../rpm  $(TEMP_DIR)/rpm
	ln -s $(ROOT_DIR)/../../build.mk  $(TEMP_DIR)/build.mk
	ln -s $(HASHKIT_DIR) $(TEMP_DIR)/$(DEPEND_PROJ)/libhashkit
	ln -s $(MEMCACHE_DIR) $(TEMP_DIR)/$(DEPEND_PROJ)/memcached
	ln -s $(JSON_DIR) $(TEMP_DIR)/$(DEPEND_PROJ)/rapidjson
	$(MAKE) clean -C $(ROOT_DIR)
	tar zchf $(TEMP_DIR)/$(SRC) --exclude "*.tar.gz" --exclude "*.d" --exclude "*.o" --exclude install --exclude bin --exclude "*.so" --exclude "*.a" --exclude "*.rpm" -C $(TEMP_DIR)  evpp apps rapidjson $(DEPEND_PROJ) rpm build.mk
	mkdir -p build/{BUILD,RPMS,SRPMS,SPECS,SOURCES}
	mv $(TEMP_DIR)/$(SRC) build/SOURCES/

clean-build:
	rm -rf build

clean-rpm:
	rm -rf *rpm

t :
	@echo $(ROOT_DIR)
	@echo $(COMMITVERSION)

clean: clean-build clean-rpm

.PHONY: pkg prepare clean clean-build clean-rpm t
{'fraction_non_alphanumeric': 0.22124123604258633, 'fraction_numerical': 0.0, 'mean_word_length': 3.5478158205430934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7450798', 'n_tokens_mistral': 1641, 'n_tokens_neox': 1552, 'n_words': 367}