From 0fe7baf891101c7858ba3fed635afde5ddfff824 Mon Sep 17 00:00:00 2001 From: Adam Samalik Date: Mon, 10 Jul 2023 08:41:48 +0200 Subject: [PATCH] re-import sources as agreed with the maintainer --- .gitignore | 2 +- Makefile | 21 +++++++++++++++++++++ tests/test-simple | 22 ++++++++++++++++++++++ tests/tests.yml | 33 +++++++++++++++++++++++++++++++++ ttmkfdir.spec | 4 ++-- 5 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 Makefile create mode 100644 tests/test-simple create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index db13160..40dc9fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/ttmkfdir-3.0.9.tar.bz2 +ttmkfdir-3.0.9.tar.bz2 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d427bd6 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: ttmkfdir +# $Id$ +NAME := ttmkfdir +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attempt a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/tests/test-simple b/tests/test-simple new file mode 100644 index 0000000..b769949 --- /dev/null +++ b/tests/test-simple @@ -0,0 +1,22 @@ +#!/bin/bash + +if [ -d /tmp/test-ttmkfdir ];then + rm -rf /tmp/test-ttmkfdir +fi + +mkdir /tmp/test-ttmkfdir +cd /tmp/test-ttmkfdir +ttmkfdir -d /usr/share/X11/fonts/TTF . +if [ -f ./fonts.scale ]; then + diff -urN ./fonts.scale /usr/share/X11/fonts/TTF/fonts.scale + retval=$? + echo $retval + if [ $retval -ne 0 ]; then + echo "FAIL: check if xorg-x11-fonts-ethiopic is installed or its packaging is changed" + exit 1 + else + echo "PASS: ttmkfdir sucessfully generated fonts.scale file for xorg-x11-fonts-ethiopic directory" + fi +fi + + diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..89d2a23 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,33 @@ +- hosts: localhost + vars: + - artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}" + tags: + - classic + remote_user: root + tasks: + - name: Install required packages + dnf: + name: + - xorg-x11-fonts-ethiopic + + - name: Install the test files + copy: src={{ item.file }} dest=/usr/local/bin/{{ item.dest }} mode=0755 + with_items: + - {file: test-simple, dest: test-simple } + + - name: Test block + block: + - name: Execute the tests + shell: | + /usr/local/bin/test-simple &> /tmp/test.log && result=pass || result=fail + echo -e "results:\n- {result: $result, test: simple}" > /tmp/results.yml + + always: + - name: Pull out the logs + fetch: + dest: "{{ artifacts }}/" + src: "{{ item }}" + flat: yes + with_items: + - /tmp/test.log + - /tmp/results.yml diff --git a/ttmkfdir.spec b/ttmkfdir.spec index ee7b361..5728fe3 100644 --- a/ttmkfdir.spec +++ b/ttmkfdir.spec @@ -40,14 +40,14 @@ by the font server. make %{?_smp_mflags} OPTFLAGS="$RPM_OPT_FLAGS" %install -make DESTDIR=$RPM_BUILD_ROOT install INSTALL="install -p" +make DESTDIR=$RPM_BUILD_ROOT PREFIX="%{_prefix}" install INSTALL="install -p" mkdir -p %{buildroot}%{_mandir}/man1/ cp -p %{SOURCE10} %{buildroot}%{_mandir}/man1/ %files %doc README %{_bindir}/ttmkfdir -%{_mandir}/man1/ttmkfdir.1.gz +%{_mandir}/man1/ttmkfdir.1* %changelog * Wed Mar 07 2018 Parag Nemade - 3.0.9-54